Browse Source

Request spec

pull/122/head
baarkerlounger 4 years ago
parent
commit
43f8456b7d
  1. 2
      app/views/organisations/show.html.erb
  2. 17
      spec/requests/organisations_controller_spec.rb

2
app/views/organisations/show.html.erb

@ -4,7 +4,7 @@
<% @organisation.display_attributes.each do |attr, val| %>
<%= summary_list.row do |row|
row.key { attr.to_s.humanize }
row.value { simple_format(val, {}, wrapper_tag: "div") }
row.value { simple_format(val.to_s, {}, wrapper_tag: "div") }
end %>
<% end %>
<% end %>

17
spec/requests/organisations_controller_spec.rb

@ -0,0 +1,17 @@
require "rails_helper"
RSpec.describe OrganisationsController, type: :request do
let(:user) { FactoryBot.create(:user) }
let(:organisation) { user.organisation }
let(:headers) { { "Accept" => "text/html" } }
before do
sign_in user
get "/organisations/#{organisation.id}", headers: headers, params: {}
end
it "shows the tab navigation" do
expected_html = "<nav class=\"app-tab-navigation\""
expect(response.body).to include(expected_html)
end
end
Loading…
Cancel
Save