From b04d8154085f10c10f0578df1b2e8f9fbf78d245 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley Date: Sat, 17 Dec 2016 17:49:43 +0000 Subject: [PATCH] Changes for code review Fixed spec --- app/assets/javascripts/templates/product_modal.html.haml | 2 +- spec/features/admin/products_spec.rb | 3 ++- spec/features/consumer/shopping/products_spec.rb | 7 ------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/templates/product_modal.html.haml b/app/assets/javascripts/templates/product_modal.html.haml index f0c77c44c0..6282bc439e 100644 --- a/app/assets/javascripts/templates/product_modal.html.haml +++ b/app/assets/javascripts/templates/product_modal.html.haml @@ -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 diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index c88b7d22bb..2cebd58dce 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -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' diff --git a/spec/features/consumer/shopping/products_spec.rb b/spec/features/consumer/shopping/products_spec.rb index cc827898c6..d8b0c2b792 100644 --- a/spec/features/consumer/shopping/products_spec.rb +++ b/spec/features/consumer/shopping/products_spec.rb @@ -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 = "

Formatted product description.

" 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("

Formatted product description.

") end - end it "does not show unsecure HTML" do - product.description = "

Safe

" product.save! @@ -59,9 +54,7 @@ feature "As a consumer I want to view products", js: true do html.should include("

Safe

") html.should_not include("") end - end - end end end \ No newline at end of file