Browse Source

Write failing test

pull/72/head
baarkerlounger 4 years ago
parent
commit
1e5a3a0127
  1. 13
      spec/features/case_log_spec.rb

13
spec/features/case_log_spec.rb

@ -402,7 +402,7 @@ RSpec.describe "Test Features" do
expect(case_log.override_net_income_validation).to be_nil expect(case_log.override_net_income_validation).to be_nil
end end
it "clears the confirmation question if the page is returned to using the back button" do it "clears the confirmation question if the amount was amended and the page is returned to using the back button" do
visit("/case_logs/#{case_log.id}/net_income") visit("/case_logs/#{case_log.id}/net_income")
fill_in("case-log-net-income-field", with: income_over_soft_limit) fill_in("case-log-net-income-field", with: income_over_soft_limit)
choose("case-log-net-income-frequency-weekly-field", allow_label_click: true) choose("case-log-net-income-frequency-weekly-field", allow_label_click: true)
@ -412,6 +412,17 @@ RSpec.describe "Test Features" do
click_link(text: "Back") click_link(text: "Back")
expect(page).not_to have_content("Are you sure this is correct?") expect(page).not_to have_content("Are you sure this is correct?")
end end
it "does not clear the confirmation question if the page is returned to using the back button and the amount is still over the soft limit" do
visit("/case_logs/#{case_log.id}/net_income")
fill_in("case-log-net-income-field", with: income_over_soft_limit)
choose("case-log-net-income-frequency-weekly-field", allow_label_click: true)
click_button("Save and continue")
check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true)
click_button("Save and continue")
click_link(text: "Back")
expect(page).to have_content("Are you sure this is correct?")
end
end end
end end

Loading…
Cancel
Save