fixup: Updates spec to create a variant within BUU design

This commit is contained in:
David Cook
2024-07-01 12:38:10 +10:00
parent 6dfef8104d
commit 3a8c44d0c6

View File

@@ -1675,10 +1675,14 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
expect {
click_on "Save changes"
expect(page).to have_content "Changes saved"
}.to change {
Spree::Variant.count
}.from(1).to(2)
click_on "Dismiss"
expect(page).not_to have_content "Changes saved"
new_variant = Spree::Variant.where(deleted_at: nil).last
expect(new_variant.sku).to eq "345"
expect(new_variant.display_name).to eq "Small bag"
@@ -1692,12 +1696,6 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
expect(new_variant.on_demand).to eq true
end
within ".flash-container" do
expect(page).to have_content "Changes saved"
click_on "Dismiss"
expect(page).not_to have_content "Changes saved"
end
within page.all("tr.condensed")[1] do # selects second variant row
page.find('input[id$="_sku"]').fill_in with: "789"
end