Browse Source

Move and rename some tests

CLDC-2055-which-organisations-are-merging
Kat 2 years ago
parent
commit
340e4f12dd
  1. 27
      spec/features/organisation_spec.rb

27
spec/features/organisation_spec.rb

@ -40,7 +40,7 @@ RSpec.describe "User Features" do
expect(page).to have_current_path("/organisations/#{org_id}/details") expect(page).to have_current_path("/organisations/#{org_id}/details")
end 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 before do
organisation.update(holds_own_stock: false) organisation.update(holds_own_stock: false)
end end
@ -51,7 +51,7 @@ RSpec.describe "User Features" do
end end
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 before do
organisation.update(holds_own_stock: true) organisation.update(holds_own_stock: true)
end end
@ -61,18 +61,6 @@ RSpec.describe "User Features" do
expect(page).to have_link("Schemes", href: "/schemes") expect(page).to have_link("Schemes", href: "/schemes")
end end
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 end
context "when users are part of organisation" do context "when users are part of organisation" do
@ -321,5 +309,16 @@ RSpec.describe "User Features" do
end end
end 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
end end

Loading…
Cancel
Save