-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Vouchers part 1 #11002
Vouchers part 1 #11002
Changes from all commits
bf912ae
074eb4b
a0d0f8f
65b6a75
13a22c5
a0f23fc
c5dfecb
06c9697
837e581
6fa3811
ef09492
11382a5
52806a3
93df70c
1a744de
202b004
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 |
---|---|---|
|
@@ -46,7 +46,6 @@ | |
= yield | ||
|
||
#footer | ||
%loading | ||
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. Nice. |
||
|
||
= yield :scripts | ||
= inject_current_hub | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ | |
|
||
it "updates fees and taxes and redirects to order details page" do | ||
expect(order).to receive(:recreate_all_fees!) | ||
expect(order).to receive(:create_tax_charge!) | ||
expect(order).to receive(:create_tax_charge!).at_least :once | ||
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. So now it's called multiple times? I would have thought that the transition happens only once. 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 puzzled over this a bit, but it looks like this happens in relation to what the test setup is doing as opposed to what happens in the test itself. Basically before the test even starts (or when the order object is called and lazy-instantiated) the process of created a completed order ( |
||
|
||
spree_put :update, params | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,7 @@ | |
|
||
before do | ||
order.cancel! | ||
order.reload | ||
order.resume! | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1114,11 +1114,8 @@ | |
let(:voucher) { create(:voucher, code: 'some_code', enterprise: distributor, amount: 6) } | ||
|
||
before do | ||
# Add voucher to the order | ||
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. These comments might seem superfluous to some, but as a first-time reader of the code, I find them a helpful narration :) |
||
voucher.create_adjustment(voucher.code, order) | ||
|
||
# Update order so voucher adjustment is properly taken into account | ||
order.update_order! | ||
order.update_totals | ||
VoucherAdjustmentsService.calculate(order) | ||
|
||
visit checkout_step_path(:summary) | ||
|
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.
As long as taxes don't change after this it should be fine. If I followed correctly taxes are recalculated if address changes, and also after the order move to the "payment" step, which all happen before we can reach this code, is that correct ?