Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee committed Dec 15, 2023
1 parent dd36630 commit 3b45057
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/service_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module ServiceScopes
scope :placements, -> { where placements: true }
scope :claims, -> { where claims: true }
end
end
end
2 changes: 0 additions & 2 deletions app/models/placements/organisation.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
class Placements::Organisation


end
11 changes: 11 additions & 0 deletions app/models/support_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
#
class SupportUser < User
default_scope { where(systems_support: true) }

def self.load_from_session(session)
return unless (dsi_user = DfESignInUser.load_from_session(session))

support_user = SupportUser.kept.find_by(dfe_sign_in_uid: dsi_user.dfe_sign_in_uid)

if support_user
support_user.impersonated_provider_user = dsi_user.impersonated_provider_user
support_user
end
end
def organisations(scope = :all)
[*School.public_send(scope), *Provider.public_send(scope)]
end
Expand Down
6 changes: 5 additions & 1 deletion config/routes/placements.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
scope module: :placements, as: :placements, constraints: { host: ENV["PLACEMENTS_HOST"] } do
scope module: :placements,
as: :placements,
constraints: {
host: ENV["PLACEMENTS_HOST"]
} do
root to: "pages#index"
end
8 changes: 6 additions & 2 deletions spec/support/shared_examples/service_scopes.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
require "rails_helper"

RSpec.shared_examples "service scopes" do
let!(:placements_on) { create(described_class.model_name.param_key.to_sym, placements: true) }
let!(:claims_on) { create(described_class.model_name.param_key.to_sym, claims: true) }
let!(:placements_on) do
create(described_class.model_name.param_key.to_sym, placements: true)
end
let!(:claims_on) do
create(described_class.model_name.param_key.to_sym, claims: true)
end

describe "#placements" do
it "only returns instances with placements on" do
Expand Down
4 changes: 1 addition & 3 deletions spec/system/home_page_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require "rails_helper"

RSpec.feature "Home Page" do
after do
Capybara.app_host = nil
end
after { Capybara.app_host = nil }

scenario "User visits the claims homepage" do
given_i_am_on_the_claims_site
Expand Down

0 comments on commit 3b45057

Please sign in to comment.