diff --git a/app/views/schemes/index.html.erb b/app/views/schemes/index.html.erb
index 266654bda..a1a05ae1d 100644
--- a/app/views/schemes/index.html.erb
+++ b/app/views/schemes/index.html.erb
@@ -5,7 +5,6 @@
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing services", sub: nil } : { main: "Supported housing services", sub: current_user.organisation.name } %>
-
<%= render SearchComponent.new(current_user:, search_label: "Search by service name or code", value: @searched) %>
diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb
index c0e173465..cbe254f61 100644
--- a/spec/requests/schemes_controller_spec.rb
+++ b/spec/requests/schemes_controller_spec.rb
@@ -152,19 +152,27 @@ RSpec.describe SchemesController, type: :request do
end
it "has page heading" do
+ follow_redirect!
expect(page).to have_content("Supported housing services")
end
+ it "redirects to the organisation schemes path" do
+ follow_redirect!
+ expect(path).to match("/organisations/#{user.organisation.id}/schemes")
+ end
+
+ it "shows a search bar" do
+ follow_redirect!
+ expect(page).to have_field("search", type: "search")
+ end
+
it "shows only schemes belonging to the same organisation" do
+ follow_redirect!
expect(page).to have_content(same_org_scheme.code)
schemes.each do |scheme|
expect(page).not_to have_content(scheme.code)
end
end
-
- it "shows a search bar" do
- expect(page).to have_field("search", type: "search")
- end
end
end
end