Add user product info
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Feature: Getting product information during an order
|
||||
|
||||
@javascript
|
||||
Scenario: Happy flow
|
||||
Given There is an open supplier with a menu
|
||||
And the product 'Heineken beer' has description 'Brewed in Amsterdam'
|
||||
And I am signed in as a user
|
||||
#And I open the debugger
|
||||
And I am on the user homepage
|
||||
#When the user scans a table QR code
|
||||
#And the user clicks on the more info button for the product with name 'Heineken beer'
|
||||
#Then the page should have content 'Brewed in Amsterdam'
|
||||
@@ -0,0 +1,6 @@
|
||||
step "the product :product_name has description :product_description" do |product_name, product_description|
|
||||
product = @product && @product.name == product_name ? @product : Product.find_by_name(product_name)
|
||||
product.description = product_description
|
||||
product.save or raise "Cannot save product: #{product.errors.full_messages.to_sentence}"
|
||||
@product ||= product
|
||||
end
|
||||
@@ -27,3 +27,8 @@ step "there is a signed in user with an active order" do
|
||||
step "I am signed in as a user"
|
||||
step "the user has an active order"
|
||||
end
|
||||
|
||||
step "the user clicks on the more info button for the product with name :product_name" do |product_name|
|
||||
product = @product && @product.name == product_name ? @product : Product.find_by_name(product_name)
|
||||
find(".order-product-#{product.id} .show-product-description").click
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user