mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Changes for code review
Fixed spec
This commit is contained in:
committed by
Rob Harrington
parent
7b370a2eb6
commit
b04d815408
@@ -16,7 +16,7 @@
|
||||
|
||||
%div{"ng-if" => "product.description_html"}
|
||||
%hr
|
||||
%p.text-small{"ng-bind-html" => "product.description_html"}
|
||||
%p.text-small{"ng-bind-html" => "::product.description_html"}
|
||||
%hr
|
||||
|
||||
.columns.small-12.large-6
|
||||
|
||||
@@ -75,7 +75,8 @@ feature %q{
|
||||
check 'product_on_demand'
|
||||
select 'Test Tax Category', from: 'product_tax_category_id'
|
||||
select 'Test Shipping Category', from: 'product_shipping_category_id'
|
||||
fill_in 'product_description', with: "In demand, and on_demand! The hottest cakes in town."
|
||||
#fill_in 'product_description', with: "In demand, and on_demand! The hottest cakes in town."
|
||||
page.first("input[name='product\[description\]']", visible: false).set('In demand, and on_demand! The hottest cakes in town.')
|
||||
|
||||
click_button 'Create'
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ feature "As a consumer I want to view products", js: true do
|
||||
include UIComponentHelper
|
||||
|
||||
describe "Viewing a product" do
|
||||
|
||||
let(:distributor) { create(:distributor_enterprise, with_payment_and_shipping: true) }
|
||||
let(:supplier) { create(:supplier_enterprise) }
|
||||
let(:oc1) { create(:simple_order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise), orders_close_at: 2.days.from_now) }
|
||||
@@ -21,14 +20,12 @@ feature "As a consumer I want to view products", js: true do
|
||||
end
|
||||
|
||||
describe "viewing HTML product descriptions" do
|
||||
|
||||
before do
|
||||
exchange1.update_attribute :pickup_time, "monday"
|
||||
add_variant_to_order_cycle(exchange1, variant)
|
||||
end
|
||||
|
||||
it "shows HTML product description" do
|
||||
|
||||
product.description = "<p><b>Formatted</b> product description.</p>"
|
||||
product.save!
|
||||
|
||||
@@ -41,11 +38,9 @@ feature "As a consumer I want to view products", js: true do
|
||||
within(".reveal-modal") do
|
||||
html.should include("<p><b>Formatted</b> product description.</p>")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
it "does not show unsecure HTML" do
|
||||
|
||||
product.description = "<script>alert('Dangerous!');</script><p>Safe</p>"
|
||||
product.save!
|
||||
|
||||
@@ -59,9 +54,7 @@ feature "As a consumer I want to view products", js: true do
|
||||
html.should include("<p>Safe</p>")
|
||||
html.should_not include("<script>alert('Dangerous!');</script>")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user