Fix bug with unlinking user orders on lists load over active list
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user