Skip to content

Commit

Permalink
Add failing feature spec for stock location bug
Browse files Browse the repository at this point in the history
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
1 parent df669d8 commit f6f24ca
Showing 1 changed file with 12 additions and 2 deletions.
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

0 comments on commit f6f24ca

Please sign in to comment.