Skip to content
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

[v4.2] Fix search by variant on stock items #5662

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add failing feature spec for stock location bug
Before we fix this bug, we should reproduce it in a feature spec.

Co-authored-by: An Stewart <[email protected]>
Co-authored-by: Adam Mueller <[email protected]>
(cherry picked from commit 2409038)
  • Loading branch information
nvandoorn committed Feb 14, 2024
commit f6f24ca983b9c04c45c358674db536a3c7cc59e1
14 changes: 12 additions & 2 deletions backend/spec/features/admin/stock_items_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
stub_authorization!

let(:admin_user) { create(:admin_user) }
let!(:variant_1) { create(:variant) }
let!(:variant_2) { create(:variant) }
let!(:variant_1) { create(:variant, product: product1) }
let!(:variant_2) { create(:variant, product: product2) }
let(:product1) { create(:product, name: 'Ruby Shirt') }
let(:product2) { create(:product, name: 'Solidus Shirt') }
let!(:stock_location) { create(:stock_location_without_variant_propagation) }

scenario 'User can add a new stock locations to any variant' do
Expand All @@ -19,4 +21,12 @@
end
expect(page).to have_content("Created successfully")
end

scenario 'searching by variant' do
visit spree.admin_stock_items_path
fill_in 'SKU or Option Value', with: 'Ruby'
click_on 'Filter Results'
expect(page).to have_content "Ruby Shirt"
expect(page).to_not have_content "Solidus Shirt"
end
end