require "rails_helper" RSpec.describe OrganisationsController, type: :request do let(:organisation) { user.organisation } let(:headers) { { "Accept" => "text/html" } } let(:page) { Capybara::Node::Simple.new(response.body) } describe "#show" do let(:user) { FactoryBot.create(:user, :data_coordinator) } before do sign_in user get "/organisations/#{organisation.id}", headers: headers, params: {} end it "redirects to details" do expect(response).to have_http_status(:redirect) end end context "As a data coordinator user" do let(:user) { FactoryBot.create(:user, :data_coordinator) } context "details tab" do before do sign_in user get "/organisations/#{organisation.id}/details", headers: headers, params: {} end it "shows the tab navigation" do expected_html = "