From 67fcf0f5348fe7304b91da453aa5f78e9ab5db60 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 17 Dec 2013 15:26:49 +1100 Subject: [PATCH] Fixing up the feature specs --- app/views/shop/_order_cycles.html.haml | 6 +++--- app/views/shop/_products.html.haml | 1 - app/views/shop/show.html.haml | 2 +- spec/features/consumer/shopping_spec.rb | 6 ++---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/views/shop/_order_cycles.html.haml b/app/views/shop/_order_cycles.html.haml index cc50a90137..691e653cc0 100644 --- a/app/views/shop/_order_cycles.html.haml +++ b/app/views/shop/_order_cycles.html.haml @@ -11,12 +11,12 @@ - else %form.custom %strong Ready for: - %select{"ng-model" => "order_cycle.order_cycle_id", + %select#order_cycle_id{"ng-model" => "order_cycle.order_cycle_id", "ng-init" => "order_cycle.order_cycle_id = #{current_order_cycle.andand.id}", "ng-change" => "changeOrderCycle()", "ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}"} %closing - %img{src: "/icon/goes/here"} + -#%img{src: "/icon/goes/here"} Orders close - %strong= current_order_cycle.orders_close_at.strftime "%A %m" + %strong= current_order_cycle.andand.orders_close_at.andand.strftime "%A %m" diff --git a/app/views/shop/_products.html.haml b/app/views/shop/_products.html.haml index 4770555f98..6d7a133c1f 100644 --- a/app/views/shop/_products.html.haml +++ b/app/views/shop/_products.html.haml @@ -9,7 +9,6 @@ %th Price %tr.product{"ng-repeat" => "product in data.products "} %td - %img{src: "{{ product.master.images[0].mini_url }}", alt: "{{product.master.images[0].alt}}"} %td {{ product.name }} %td {{ product.description }} diff --git a/app/views/shop/show.html.haml b/app/views/shop/show.html.haml index 33c02ccf58..7454bd9fdd 100644 --- a/app/views/shop/show.html.haml +++ b/app/views/shop/show.html.haml @@ -1,7 +1,7 @@ %shop{"ng-app" => "Shop"} %navigation %distributor.details.row - %img{src: "/route/to/distributor/icon"} + -#%img{src: "/route/to/distributor/icon"} %h3 = @distributor.name %location= @distributor.address.city diff --git a/spec/features/consumer/shopping_spec.rb b/spec/features/consumer/shopping_spec.rb index 100029a6e7..226d57eb67 100644 --- a/spec/features/consumer/shopping_spec.rb +++ b/spec/features/consumer/shopping_spec.rb @@ -26,9 +26,6 @@ feature "As a consumer I want to shop with a distributor", js: true do visit shop_path page.should have_selector "option[selected]", text: 'turtles' - - # Should see order cycle selected in dropdown - # (Should also render productspath end describe "with multiple order cycles" do @@ -45,7 +42,6 @@ feature "As a consumer I want to shop with a distributor", js: true do visit shop_path page.should have_selector "option", text: 'frogs' page.should have_selector "option", text: 'turtles' - page.should_not have_selector "option[selected]" end describe "with products in our order cycle" do @@ -60,6 +56,7 @@ feature "As a consumer I want to shop with a distributor", js: true do it "allows us to select an order cycle" do select "frogs", :from => "order_cycle_id" page.should have_selector "products" + sleep 5 Spree::Order.last.order_cycle.should == oc1 end @@ -71,6 +68,7 @@ feature "As a consumer I want to shop with a distributor", js: true do select "frogs", :from => "order_cycle_id" page.should have_content product.name end + end end