Time dependant product categories for users
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
step "the product category lunch is not visible today" do
|
||||
@category_lunch.update_attributes "active_on_#{Date.today.day_name}" => false
|
||||
end
|
||||
|
||||
step "the product category lunch is visible at this time" do
|
||||
@category_lunch.update_attributes full_day: false,
|
||||
start_from: 10.minutes.ago.getlocal.minute_of_day,
|
||||
end_on: 10.minutes.from_now.getlocal.minute_of_day
|
||||
end
|
||||
|
||||
step "the product category lunch is visible later than now" do
|
||||
@category_lunch.update_attributes full_day: false,
|
||||
start_from: 10.minutes.from_now.getlocal.minute_of_day,
|
||||
end_on: 1440
|
||||
end
|
||||
|
||||
step "the product category lunch is visible earlyer than now" do
|
||||
@category_lunch.update_attributes full_day: false,
|
||||
start_from: 0,
|
||||
end_on: 10.minutes.ago.getlocal.minute_of_day
|
||||
end
|
||||
@@ -31,3 +31,7 @@ end
|
||||
step "I open the debugger" do
|
||||
binding.pry
|
||||
end
|
||||
|
||||
step 'I reload the page' do
|
||||
page.driver.browser.navigate.refresh()
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ step "I am on the user homepage" do
|
||||
end
|
||||
|
||||
step "the user is on the homepage" do
|
||||
visit user_root_path
|
||||
visit '/user'
|
||||
end
|
||||
|
||||
step "the user should be redirected to the user order overview page" do
|
||||
|
||||
@@ -130,3 +130,12 @@ step "the user has an active list with a/an :order_status order" do |order_statu
|
||||
end
|
||||
end
|
||||
|
||||
step "the user page contains the product category lunch" do
|
||||
js_text("#product-category-#{@category_lunch.id} .product_category-title").should include @category_lunch.name
|
||||
end
|
||||
step "the user page contains the product category beer" do
|
||||
js_text("#product-category-#{@category_beer.id} .product_category-title").should include @category_beer.name
|
||||
end
|
||||
step "the user page does not contain the product category lunch" do
|
||||
page.should_not have_selector "#product-category-#{@category_lunch.id} .product_category-title"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user