forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not process order returns automatically in #process_inventory_unit…
…! callback Processing order returns in `ReturnItem#process_inventory_unit!` does not work reliably when there are multiple return items processed at the same time (see issue solidusio#3198). Also, decoupling sensible interactions with other models in ActiveRecord callbacks simplifies the understandability of code and its flow. Order processing in `#process_inventory_unit!` is now only deprecated, but will be completely removed in the following release of Solidus.
- Loading branch information
1 parent
4955822
commit ea9193e
Showing
4 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
backend/spec/features/admin/orders/customer_returns_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'Customer returns', type: :feature do | ||
stub_authorization! | ||
|
||
context 'when the order has more than one line item' do | ||
let(:order) { create :shipped_order, line_items_count: 2 } | ||
|
||
context 'when creating a return with state "Received"' do | ||
it 'marks the order as returned', :js do | ||
visit spree.new_admin_order_customer_return_path(order) | ||
|
||
find('#select-all').click | ||
page.execute_script "$('select.add-item').val('receive')" | ||
select 'NY Warehouse', from: 'Stock Location' | ||
click_button 'Create' | ||
|
||
expect(page).to have_content 'Customer Return has been successfully created' | ||
|
||
within 'dd.order-state' do | ||
expect(page).to have_content 'Returned' | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters