Browse Source

tests for data coordinator user

pull/648/head
JG 3 years ago
parent
commit
842872d470
  1. 1
      app/views/schemes/index.html.erb
  2. 16
      spec/requests/schemes_controller_spec.rb

1
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) %>
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m">

16
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

Loading…
Cancel
Save