Browse Source

refactored specs moved into orgs what belongs there

pull/648/head
JG 3 years ago
parent
commit
1ca0efeb26
  1. 2
      app/controllers/schemes_controller.rb
  2. 4
      spec/requests/organisations_controller_spec.rb
  3. 4
      spec/requests/schemes_controller_spec.rb

2
app/controllers/schemes_controller.rb

@ -6,7 +6,7 @@ class SchemesController < ApplicationController
before_action :authenticate_scope!
def index
redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support?
redirect_to supported_housing_organisation_path(current_user.organisation) unless current_user.support?
all_schemes = Scheme.all
@pagy, @schemes = pagy(filtered_collection(all_schemes, search_term))

4
spec/requests/organisations_controller_spec.rb

@ -48,10 +48,6 @@ RSpec.describe OrganisationsController, type: :request do
expect(page).to have_content("Supported housing services")
end
it "redirects to the organisation schemes path" do
expect(path).to match("/organisations/#{user.organisation.id}/schemes")
end
it "shows a search bar" do
expect(page).to have_field("search", type: "search")
end

4
spec/requests/schemes_controller_spec.rb

@ -151,9 +151,9 @@ RSpec.describe SchemesController, type: :request do
get "/supported-housing"
end
it "has page heading" do
it "redirects to the organisation schemes path" do
follow_redirect!
expect(page).to have_content("Supported housing services")
expect(path).to match("/organisations/#{user.organisation.id}/supported-housing")
end
end
end

Loading…
Cancel
Save