Fixing up the feature specs

This commit is contained in:
Will Marshall
2013-12-17 15:26:49 +11:00
parent c4c5f3a8c7
commit 67fcf0f534
4 changed files with 6 additions and 9 deletions

View File

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

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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