diff --git a/app/controllers/schemes_controller.rb b/app/controllers/schemes_controller.rb index 5cfde3dcf..971b4bc04 100644 --- a/app/controllers/schemes_controller.rb +++ b/app/controllers/schemes_controller.rb @@ -88,7 +88,7 @@ class SchemesController < ApplicationController private - def confirm_secondary_page? page + def confirm_secondary_page?(page) page == "confirm-secondary" && @scheme.has_other_client_group == "Yes" end diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb index 4ddd14a92..3addfd76b 100644 --- a/spec/models/organisation_spec.rb +++ b/spec/models/organisation_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Organisation, type: :model do describe "#new" do let(:user) { FactoryBot.create(:user) } let!(:organisation) { user.organisation } - let!(:scheme) { FactoryBot.create(:scheme, organisation: organisation, stock_owning_organisation: organisation) } + let!(:scheme) { FactoryBot.create(:scheme, organisation:, stock_owning_organisation: organisation) } it "has expected fields" do expect(organisation.attribute_names).to include("name", "phone", "provider_type") @@ -14,15 +14,11 @@ RSpec.describe Organisation, type: :model do expect(organisation.users.first).to eq(user) end - it "has schemes" do + it "has managed_schemes" do expect(organisation.managed_schemes.first).to eq(scheme) end - it "has schemes" do - expect(organisation.managed_schemes.first).to eq(scheme) - end - - it "has schemes" do + it "has owned_schemes" do expect(organisation.owned_schemes.first).to eq(scheme) end