
step "the user clicks on the order :product_name twice" do |product_name|
  @last_product = instance_variable_get product_name.underscore.gsub(/\s/, '_').prepend('@')
  button = find ".order-product-#{@last_product.id} .add-product-to-list"
  2.times { button.click }
end

step "the user clicks on the order product button :product_name" do |product_name|
  @last_product = instance_variable_get product_name.underscore.gsub(/\s/, '_').prepend('@')
  button = find ".order-product-#{@last_product.id} .add-product-to-list"
  button.click
end

step "the user clicks on the user order button" do
  find('.order-selected-products-button').click
  sleep 1
end

step "the user has an active order" do
  step 'there is a section'
  step 'there is a table'
  step 'the user has an active list'

end

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

step "the user page should have product information :product_description" do |product_description|
  page.should have_content product_description
end
