Fix bug with unlinking user orders on lists load over active list
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Feature: Active list view
|
||||
|
||||
@javascript
|
||||
Scenario: Loading lists and switching back to the active list
|
||||
Given There is an open supplier with a menu
|
||||
And there is a signed in user with an active order
|
||||
And the user is on the active list page
|
||||
When the user opens the side menu
|
||||
And the user clicks on the lists link in the side menu
|
||||
And the user opens the side menu again
|
||||
And the user clicks on the active list link in the side menu
|
||||
Then the user should see the order in the active list view
|
||||
@@ -9,6 +9,9 @@ end
|
||||
|
||||
step "the user has an active list" do
|
||||
@list = create :list, supplier: @supplier, table: @table, user_ids: [@user.id]
|
||||
@product ||= create :product, supplier: @supplier, name: 'Beer', price: 2.34
|
||||
@order = create :order, supplier: @supplier, list: @list
|
||||
@product_order = create :product_order, order: @order, product: @product, quantity: 2, price: 2.34
|
||||
@user.reload
|
||||
@user.active_list_id = @list.id
|
||||
@user.save
|
||||
@@ -29,4 +32,3 @@ end
|
||||
step "I am signed in as a user" do
|
||||
step "I visit the user obtain token path"
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
step "the user is on the active list page" do
|
||||
visit "/user#/active_list"
|
||||
end
|
||||
|
||||
step "the user should see the order in the active list view" do
|
||||
page.evaluate_script(%|$('.order-row-#{@order.id}').text()|).first(14).should == '2 x Beer€ 4.68'
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
step "the user opens the side menu" do
|
||||
page.execute_script %|$('.toggle-side-menu').click()|
|
||||
sleep 1
|
||||
end
|
||||
step "the user opens the side menu again" do
|
||||
step "the user opens the side menu"
|
||||
end
|
||||
|
||||
step "the user clicks on the lists link in the side menu" do
|
||||
page.execute_script %|$('.side-menu-lists').click()|
|
||||
end
|
||||
|
||||
step "the user clicks on the active list link in the side menu" do
|
||||
page.execute_script %|$('.side-menu-active-list').click()|
|
||||
end
|
||||
@@ -14,4 +14,8 @@ module SpecEmberHelpers
|
||||
SCRIPT
|
||||
JSON.parse(h)
|
||||
end
|
||||
|
||||
def js_path
|
||||
page.evaluate_script 'location.pathname + location.hash'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user