From 340e4f12dd0d339733b8cc4de1a971618b681fe1 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 5 Apr 2023 10:39:05 +0100 Subject: [PATCH] Move and rename some tests --- spec/features/organisation_spec.rb | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index bc6aa243a..7e25fe933 100644 --- a/spec/features/organisation_spec.rb +++ b/spec/features/organisation_spec.rb @@ -40,7 +40,7 @@ RSpec.describe "User Features" do expect(page).to have_current_path("/organisations/#{org_id}/details") end - context "when the user is a coordinator and the organisation does not hold housing stock" do + context "and the organisation does not hold housing stock" do before do organisation.update(holds_own_stock: false) end @@ -51,7 +51,7 @@ RSpec.describe "User Features" do end end - context "when the user is a coordinator and the organisation holds housing stock" do + context "and the organisation holds housing stock" do before do organisation.update(holds_own_stock: true) end @@ -61,18 +61,6 @@ RSpec.describe "User Features" do expect(page).to have_link("Schemes", href: "/schemes") end end - - context "when the user is support and the organisation does not hold housing stock" do - before do - organisation.update!(holds_own_stock: false) - user.update!(role: "support") - end - - it "does not show schemes in the primary or secondary navigation bar on the organisations page" do - visit("/organisations") - expect(page).not_to have_link("Schemes", href: "/schemes", count: 2) - end - end end context "when users are part of organisation" do @@ -321,5 +309,16 @@ RSpec.describe "User Features" do end end end + + context "and the organisation does not hold housing stock" do + before do + organisation.update!(holds_own_stock: false) + end + + it "does not show schemes in the primary or secondary navigation bar on the organisations page" do + visit("/organisations") + expect(page).not_to have_link("Schemes", href: "/schemes", count: 2) + end + end end end