diff --git a/spec/features/consumer/shopping/products_spec.rb b/spec/features/consumer/shopping/products_spec.rb index c4f101de0f..b23bef7c27 100644 --- a/spec/features/consumer/shopping/products_spec.rb +++ b/spec/features/consumer/shopping/products_spec.rb @@ -31,7 +31,7 @@ describe "As a consumer I want to view products", js: true do end it "shows HTML product description" do - product.description = "

Formatted product description.

" + product.description = '

Formatted product description.

Link to an external site' product.save! visit shop_path @@ -42,7 +42,26 @@ describe "As a consumer I want to view products", js: true do modal_should_be_open_for product within(".reveal-modal") do - expect(html).to include("

Formatted product description.

") + expect(html).to include('

Formatted product description.

Link to an external site') + end + + # -- edit product via admin interface + login_as_admin_and_visit spree.edit_admin_product_path(product) + expect(page.find("div[id^='taTextElement']")['innerHTML']).to include('external site') + + fill_in 'product_name', with: product.name + "_update" + click_button 'Update' + + # -- check back consumer product view + visit shop_path + expect(page).to have_content(product.name + "_update") + click_link(product.name + "_update") + + expect(page).to have_selector '.reveal-modal' + modal_should_be_open_for product + + within(".reveal-modal") do + expect(html).to include('

Formatted product description.

Link to an external site') end end