diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index 9b0e934f6..797b7600e 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -123,6 +123,17 @@ RSpec.describe OrganisationsController, type: :request do end end + it "shows incomplete schemes at the top" do + schemes[0].update!(confirmed: nil, owning_organisation: user.organisation) + schemes[2].update!(confirmed: false, owning_organisation: user.organisation) + schemes[4].update!(confirmed: false, owning_organisation: user.organisation) + get "/organisations/#{organisation.id}/schemes", headers:, params: {} + + expect(page.all(".govuk-tag")[1].text).to eq("Incomplete") + expect(page.all(".govuk-tag")[2].text).to eq("Incomplete") + expect(page.all(".govuk-tag")[3].text).to eq("Incomplete") + end + context "with schemes that are not in scope for the user, i.e. that they do not belong to" do let!(:unauthorised_organisation) { FactoryBot.create(:organisation) } diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 0769e15c6..5e6bb4fab 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -66,6 +66,17 @@ RSpec.describe SchemesController, type: :request do assert_select ".govuk-tag", text: /Incomplete/, count: 1 end + it "shows incomplete schemes at the top" do + schemes[0].update!(confirmed: nil) + schemes[2].update!(confirmed: false) + schemes[4].update!(confirmed: false) + get "/schemes" + + expect(page.all(".govuk-tag")[1].text).to eq("Incomplete") + expect(page.all(".govuk-tag")[2].text).to eq("Incomplete") + expect(page.all(".govuk-tag")[3].text).to eq("Incomplete") + end + it "displays a link to check answers page if the scheme is incomplete" do scheme = schemes[0] scheme.update!(confirmed: nil)