Skip to content

Commit ccff0fa

Browse files
fixes spec for audit csv items header
1 parent a99bb41 commit ccff0fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/models/audit_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,17 @@
132132
let!(:audit) { create(:audit, :with_items, organization: organization) }
133133
let!(:audit_2) { create(:audit, :with_items, organization: organization) }
134134
let(:sl) { audit.storage_location }
135+
let(:sl2) { audit_2.storage_location }
135136

136137
it "generates a CSV" do
137138
csv_data = described_class.generate_csv([audit, audit_2])
138139

139140
expect(csv_data).to be_a(String)
140141
expect(csv_data).to eq(
141142
<<~CSV
142-
Audit Date,Audit Status,Storage Location Name,1Dont test this,2Dont test this
143+
Audit Date,Audit Status,Storage Location Name,#{audit.line_items.first.name},#{audit_2.line_items.first.name}
143144
#{audit.updated_at.strftime("%B %d %Y")},#{audit.status},#{sl.name},#{audit.line_items.first.quantity},0
144-
#{audit_2.updated_at.strftime("%B %d %Y")},#{audit_2.status},#{sl.name},0,#{audit_2.line_items.first.quantity}
145+
#{audit_2.updated_at.strftime("%B %d %Y")},#{audit_2.status},#{sl2.name},0,#{audit_2.line_items.first.quantity}
145146
CSV
146147
)
147148
end

0 commit comments

Comments
 (0)