Skip to content

Commit

Permalink
tweak specs
Browse files Browse the repository at this point in the history
  • Loading branch information
willc-work committed Oct 11, 2024
1 parent eef5b62 commit cb91270
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/views/results/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
= t(@check.controlled? ? ".controlled_qualifies" : ".likely_to_qualify")

- content_for :back do
- if FeatureFlags.enabled?(:ee_banner, @check.session_data) && @early_result_type == "gross_income"
- if FeatureFlags.enabled?(:ee_banner, @check.session_data) && @early_result_type == "gross_income"
= back_link(@previous_step, true)
-else
= link_to t("generic.back"), check_answers_path(assessment_code: params[:assessment_code]), class: "govuk-back-link"
Expand Down
24 changes: 0 additions & 24 deletions spec/flows/early_result_change_answers_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,6 @@ def stub_under_18_eligible
end

context "when the new ee_banner is implemented", :ee_banner do
context "when skipping to results page", :stub_cfe_gross_ineligible do
before do
start_assessment
fill_in_forms_until(:employment_status)
fill_in_employment_status_screen(choice: "Employed")
fill_in_income_screen(gross: "4000")
fill_in_benefits_screen
fill_in_other_income_screen
end

it "shows the banner when returning to the page with the back button" do
expect(page).to have_content("Gross monthly income limit exceeded by")
expect(page).to have_content("We have enough information to tell you that your client is not likely to qualify for legal aid.")
expect(page).to have_content("Go to results page")
click_on "Go to results page"
expect(page).to have_current_path(/\A\/check-result/)
click_on "Back"
pp page
# confirm_screen("outgoings")
expect(page).to have_content("Gross monthly income limit exceeded by")
end

end

context "when starting as ineligible on gross income but continuing the check", :stub_cfe_gross_ineligible do
before do
start_assessment
Expand Down
10 changes: 10 additions & 0 deletions spec/flows/early_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@
expect(page).to have_content "Your client's key eligibility totals"
end

# it "when I go straight to results and use the back button it shows the banner" do
# confirm_screen("outgoings")
# expect(page).to have_content("Gross monthly income limit exceeded")
# click_on "Go to results page"
# expect(page).to have_current_path(/\A\/check-result/)
# expect(page).to have_content "Your client's key eligibility totals"
# click_on "Back"
# expect(page).to have_content("Gross monthly income limit exceeded by")
# end

context "when the early eligibility changes" do
it "back links and banner work as expected" do
confirm_screen("outgoings")
Expand Down

0 comments on commit cb91270

Please sign in to comment.