From c7e82c8c1d04bcf2299a405f564233f1b955d6e4 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:53:46 +0100 Subject: [PATCH] Add test --- spec/features/schemes_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 7b94cb298..8c13980d8 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -99,6 +99,21 @@ RSpec.describe "Schemes scheme Features" do expect(page).not_to have_link("Clear", href: "/clear-filters?filter_type=schemes") end end + + context "when on the scheme question page" do + + let(:lettings_log) { FactoryBot.create(:lettings_log, assigned_to: user, needstype: 2) } + + it "open from guidance page with filters cleared" do + expect(page).to have_text("2 filters applied") + visit("/lettings-logs/#{lettings_log.id}/scheme") + find(".govuk-details__summary").click + expect(page).to have_link("View your organisation’s schemes") + click_link "View your organisation’s schemes" + expect(page).to have_current_path("/organisations/#{user.organisation.id}/schemes") + expect(page).to have_text("No filters applied") + end + end end end end