diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index f4b802f2e..cbc5a7f49 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -123,12 +123,13 @@ RSpec.describe OrganisationsController, type: :request do end end - it "shows schemes in alpabetical order" do + it "shows schemes in alphabetical order" do schemes[0].update!(service_name: "aaa", owning_organisation: user.organisation) schemes[1].update!(service_name: "daa", owning_organisation: user.organisation) schemes[2].update!(service_name: "baa", owning_organisation: user.organisation) schemes[3].update!(service_name: "Faa", owning_organisation: user.organisation) schemes[4].update!(service_name: "Caa", owning_organisation: user.organisation) + same_org_scheme.update!(service_name: "zzz", owning_organisation: user.organisation) get "/organisations/#{organisation.id}/schemes", headers:, params: {} all_links = page.all(".govuk-link") scheme_links = all_links.select { |link| link[:href] =~ %r{^/schemes/\d+$} } @@ -138,6 +139,7 @@ RSpec.describe OrganisationsController, type: :request do expect(scheme_links[2][:href]).to eq("/schemes/#{schemes[4].id}") expect(scheme_links[3][:href]).to eq("/schemes/#{schemes[1].id}") expect(scheme_links[4][:href]).to eq("/schemes/#{schemes[3].id}") + expect(scheme_links[5][:href]).to eq("/schemes/#{same_org_scheme.id}") end context "with schemes that are not in scope for the user, i.e. that they do not belong to" do diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 61fcd207d..33e0dcfd5 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -201,7 +201,7 @@ RSpec.describe SchemesController, type: :request do assert_select ".govuk-tag", text: /Incomplete/, count: 1 end - it "shows schemes in alpabetical order" do + it "shows schemes in alphabetical order" do schemes[0].update!(service_name: "aaa") schemes[1].update!(service_name: "daa") schemes[2].update!(service_name: "baa")