Browse Source

CLDC-3357-Previously-applied-filters-not-clearing (#2528)

demo-branch-08-01
Manny Dinssa 5 months ago committed by GitHub
parent
commit
ae190b268d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/views/form/guidance/_finding_scheme.erb
  2. 14
      spec/features/schemes_spec.rb

2
app/views/form/guidance/_finding_scheme.erb

@ -1,6 +1,6 @@
<%= govuk_details(summary_text: "Can’t find your scheme?") do %> <%= govuk_details(summary_text: "Can’t find your scheme?") do %>
<p class="govuk-body">Schemes are attached to the organisation that owns the property. Check you have correctly answered question 1 "Which organisation owns this property?"</p> <p class="govuk-body">Schemes are attached to the organisation that owns the property. Check you have correctly answered question 1 "Which organisation owns this property?"</p>
<p class="govuk-body">If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.</p> <p class="govuk-body">If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.</p>
<p class="govuk-body"><%= govuk_link_to("View your organisation’s schemes", schemes_path) %></p> <p class="govuk-body"><%= govuk_link_to("View your organisation’s schemes", clear_filters_url(filter_type: "schemes")) %></p>
<p class="govuk-body"><%= govuk_link_to("Read more about how schemes have changed", scheme_changes_path) %></p> <p class="govuk-body"><%= govuk_link_to("Read more about how schemes have changed", scheme_changes_path) %></p>
<% end %> <% end %>

14
spec/features/schemes_spec.rb

@ -99,6 +99,20 @@ RSpec.describe "Schemes scheme Features" do
expect(page).not_to have_link("Clear", href: "/clear-filters?filter_type=schemes") expect(page).not_to have_link("Clear", href: "/clear-filters?filter_type=schemes")
end end
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 end
end end

Loading…
Cancel
Save