-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NJ 271 - fix when review screen displays health insurance section #5457
Changes from 1 commit
8d0d43e
0103754
8d7e304
5fd9080
c560923
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe StateFile::Questions::NjReviewController do | ||
let(:intake) { create :state_file_nj_intake, :df_data_minimal } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [dust] - should we use one of the more realistic profiles here? and then use mocks below as needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's a good point - happy to make a new import for springsteen that represents no dependents. |
||
before do | ||
sign_in intake | ||
end | ||
|
||
describe "#edit" do | ||
render_views | ||
it 'succeeds' do | ||
get :edit | ||
expect(response).to be_successful | ||
end | ||
|
||
context 'when no dependents and gross income at threshold' do | ||
it 'does not show the dependents without health insurance block' do | ||
allow_any_instance_of(Efile::Nj::Nj1040Calculator).to receive(:calculate_line_29).and_return 20_000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is a test or app functionality but just highlighting that the income threshold is just one of the exceptions to health insurance eligibility (the other being claimed as dependents on another return) and it's 20k for some filing statuses, 10k for others There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is a good point - instead of getting into this or that reason for eligibility, which is all tested elsewhere, the mock here can have something like:
|
||
get :edit | ||
expect(response.body).not_to have_text "Dependents who DO NOT have health insurance" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pebble] - I think if we have this test, we should pair it with a test case for the opposite when we do expect the text |
||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the second conditional necessary? If they answered no to the health insurance eligibility question, they either will be offboarded (and so will never get to the review screen) or they meet an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great catch -- it was in the previous code so not introduced here, but I suspect that if we took it out then tests would probably still pass and would be cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some digging, I think you're right! This second condition is redundant because anyone at this point would have been screened out if they answered yes and didn't have an exception. Truth table below to validate that the logic behaves identically:
current_intake.has_health_insurance_requirement_exception? || current_intake.eligibility_all_members_health_insurance_no?
Exception True, Insurance_no? True = conditional True
Exception False, Insurance_no? True - screened out
Exception True, Insurance_no? False = conditional True
Exception False, Insurance_no? False = conditional False
current_intake.has_health_insurance_requirement_exception?
Exception True, Insurance_no? True = conditional True
Exception False, Insurance_no? True - screened out
Exception True, Insurance_no? False = conditional True
Exception False, Insurance_no? False = conditional False