mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add sytem spec for product preview on product edit page
This commit is contained in:
@@ -347,13 +347,28 @@ RSpec.describe '
|
||||
end
|
||||
|
||||
it "editing a product" do
|
||||
login_as_admin
|
||||
visit spree.edit_admin_product_path product
|
||||
|
||||
fill_in_trix_editor 'product_description', with: 'A description...'
|
||||
|
||||
click_button 'Update'
|
||||
|
||||
expect(flash_message).to eq('Product "a product" has been successfully updated!')
|
||||
product.reload
|
||||
expect(product.description).to eq("<div>A description...</div>")
|
||||
|
||||
# Product preview
|
||||
click_link 'Preview'
|
||||
|
||||
within "#product-preview-modal" do
|
||||
expect(page).to have_content("Product preview")
|
||||
expect(page).to have_selector("h3 a span", text: "a product")
|
||||
|
||||
click_button "Close"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content("Product preview")
|
||||
end
|
||||
|
||||
it "editing product group buy options" do
|
||||
|
||||
Reference in New Issue
Block a user