mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add translation for product cloned message
A validation error shouldn't happen. If it does, it's an exception, not an error.
This commit is contained in:
@@ -82,13 +82,9 @@ module Spree
|
||||
|
||||
def clone
|
||||
@new = @product.duplicate
|
||||
raise "Clone failed" unless @new.save
|
||||
|
||||
flash[:success] = if @new.save
|
||||
Spree.t('notice_messages.product_cloned')
|
||||
else
|
||||
Spree.t('notice_messages.product_not_cloned')
|
||||
end
|
||||
|
||||
flash[:success] = t('.success')
|
||||
redirect_to spree.admin_products_url
|
||||
end
|
||||
|
||||
|
||||
@@ -4348,6 +4348,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
bulk_unit_size: Bulk unit size
|
||||
display_as:
|
||||
display_as: Display As
|
||||
clone:
|
||||
success: Product cloned
|
||||
reports:
|
||||
table:
|
||||
select_and_search: "Select filters and click on %{option} to access your data."
|
||||
|
||||
@@ -237,7 +237,6 @@ describe 'As an admin, I can see the new product page', feature: :admin_style_v3
|
||||
expect(page).to have_css "button[aria-label='On Hand']", text: "6"
|
||||
end
|
||||
|
||||
pending
|
||||
expect(page).to have_content "Changes saved"
|
||||
end
|
||||
|
||||
@@ -398,6 +397,8 @@ describe 'As an admin, I can see the new product page', feature: :admin_style_v3
|
||||
click_link('Clone')
|
||||
end
|
||||
|
||||
expect(page).to have_content "Product cloned"
|
||||
|
||||
within "table.products" do
|
||||
# Gather input values, because page.content doesn't include them.
|
||||
input_content = page.find_all('input[type=text]').map(&:value).join
|
||||
|
||||
Reference in New Issue
Block a user