|
|
@ -381,14 +381,26 @@ RSpec.describe "Test Features" do |
|
|
|
context "given a weekly net income that is above the expected amount for the given economic status but below the hard max" do |
|
|
|
context "given a weekly net income that is above the expected amount for the given economic status but below the hard max" do |
|
|
|
let!(:case_log){ FactoryBot.create(:case_log, :in_progress, person_1_economic_status: "Full-time - 30 hours or more") } |
|
|
|
let!(:case_log){ FactoryBot.create(:case_log, :in_progress, person_1_economic_status: "Full-time - 30 hours or more") } |
|
|
|
let(:income_over_soft_limit) { 750 } |
|
|
|
let(:income_over_soft_limit) { 750 } |
|
|
|
|
|
|
|
let(:income_under_soft_limit) { 700 } |
|
|
|
|
|
|
|
|
|
|
|
it "prompts the user to confirm the value is correct" do |
|
|
|
it "prompts the user to confirm the value is correct" 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) |
|
|
|
click_button("Save and continue") |
|
|
|
click_button("Save and continue") |
|
|
|
expect(page).to have_current_path("/case_logs/#{case_log.id}/net_income") |
|
|
|
check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true) |
|
|
|
expect(page).to have_unchecked_field("case-log-override-net-income-validation-override-net-income-validation-field") |
|
|
|
click_button("Save and continue") |
|
|
|
|
|
|
|
expect(page).to have_current_path("/case_logs/#{case_log.id}/net_income_uc_proportion") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not require confirming the value if the value is amended" 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") |
|
|
|
|
|
|
|
fill_in("case-log-net-income-field", with: income_under_soft_limit) |
|
|
|
|
|
|
|
click_button("Save and continue") |
|
|
|
|
|
|
|
expect(page).to have_current_path("/case_logs/#{case_log.id}/net_income_uc_proportion") |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|