-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3199 from nebulab/spaghetticode/fix-3198-order-st…
…ate-after-return Allow order with multiple line items to be marked as "Returned"
- Loading branch information
Showing
6 changed files
with
53 additions
and
4 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
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