Skip to content

Commit

Permalink
Update order_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
paroga authored Mar 24, 2021
1 parent b2ebaf7 commit 3aef1b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/models/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,22 @@
let!(:order) { create :order, article_count: 1 }
let!(:oa) { order.order_articles.first }
let!(:go) { create :group_order, order: order, transport: transport }
let!(:goa) { create :group_order_article, group_order: go, order_article: oa, quantity: 1 }

before do
create :group_order_article, group_order: go, order_article: oa, quantity: 1
goa.update_quantities(1, 0)
go.reload
go.update_price!
user.ordergroup.update_stats!
oa.update_results!

order.finish!(user)
order.reload
order.close!(user, ftt)
end

it 'creates financial transaction with correct amount' do
expect(goa.result).to be > 0
expect(go.ordergroup.financial_transactions.last.amount).to eq(-go.total)
end
end
Expand Down

0 comments on commit 3aef1b1

Please sign in to comment.