Skip to content

Commit 4182295

Browse files
author
Olexii Kasianenko
committed
fix(kit_creation): Update line items setup in tests for consistent value calculation
1 parent b9d607b commit 4182295

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

spec/services/kit_create_service_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@
1616
end
1717

1818
let!(:line_items_attr) do
19-
items = create_list(:item, 3, organization: organization)
19+
items = create_list(:item, 3, value_in_cents: 2000, organization: organization)
2020
items.map do |item|
2121
{
2222
item_id: item.id,
23-
quantity: Faker::Number.number(digits: 2)
23+
quantity: 1
2424
}
2525
end
2626
end
2727
let(:kit_value_in_cents) do
28-
line_items_attr.sum do |li|
29-
item = Item.find(li[:item_id])
30-
item.value_in_cents.to_i * li[:quantity].to_i
31-
end
28+
6000
3229
end
3330

3431
it 'should return an the instance' do

0 commit comments

Comments
 (0)