Skip to content

Commit

Permalink
PR comments and cleanup (#5461)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmazanec22 authored Jan 30, 2025
1 parent ab6a0fd commit a256175
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/helpers/state_file/nj_2450_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_wages(w2)
end

def get_column_a(w2)
column_a = w2.box14_ui_wf_swf&.positive? ? w2.box14_ui_wf_swf : w2.box14_ui_hc_wd
column_a = w2.get_box14_ui_overwrite || 0
column_a&.round || 0
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def document
build_xml_doc("FormNJ2450") do |xml|
w2s.each do |w2|
xml.Body do
column_a = w2.box14_ui_wf_swf&.positive? ? w2.box14_ui_wf_swf : w2.box14_ui_hc_wd

xml.EmployerName get_employer_name(w2, truncate: true)
xml.FedEmployerId w2.employer_ein
xml.Wages get_wages(w2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
it "fills body for each w2" do
body_elements = xml.css("Body")
expect(body_elements.count).to eq 2
w2_long_employer_name = body_elements[0]
expect(w2_long_employer_name.at('EmployerName').text.length).to eq(35)

body_elements.each do |body|
w2 = [w2_1, w2_2].find { |test_w2| test_w2.employer_ein == body.at('FedEmployerId').text}

expect(body.at('EmployerName').text).to eq(w2.employer_name[0...35])
if w2.employer_name == long_employer_name
expect(body.at('EmployerName').text.length).to eq(35)
end
expect(body.at('Wages').text).to eq(w2.wages.round.to_s)
expect(body.at('Deductions ColumnA').text).to eq(w2.box14_ui_hc_wd.round.to_s)
expect(body.at('Deductions ColumnC').text).to eq(w2.box14_fli.round.to_s)
Expand Down

0 comments on commit a256175

Please sign in to comment.