Better tests
This commit is contained in:
@@ -64,8 +64,8 @@ end
|
||||
step "the user order :product_name should be in the order list with price" do |product_name|
|
||||
concerning_product = Product.find_by_name(product_name)
|
||||
#ember_order = ember_store['product_orders'].find{|po| po['product_id'] == concerning_product.id}
|
||||
ember_order = ember_find('product_order', concerning_product.id)
|
||||
binding.pry
|
||||
#ember_order = ember_find('product_order', concerning_product.id)
|
||||
ember_order = ember_all('product_order').find{|po| po['product_id'] == concerning_product.id }
|
||||
quantity = ember_order['quantity']
|
||||
order_price = quantity * concerning_product.price
|
||||
within '.product-orders .product-order' do
|
||||
|
||||
@@ -9,6 +9,7 @@ end
|
||||
|
||||
step "the user clicks on the lists link in the side menu" do
|
||||
page.execute_script %|$('.side-menu-lists').click()|
|
||||
sleep 1
|
||||
end
|
||||
|
||||
step "the user clicks on the about link in the side menu" do
|
||||
@@ -16,6 +17,7 @@ step "the user clicks on the about link in the side menu" do
|
||||
end
|
||||
|
||||
step "the user clicks on the active list link in the side menu" do
|
||||
binding.pry
|
||||
page.execute_script %|$('.side-menu-active-list').click()|
|
||||
end
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@ module SpecEmberHelpers
|
||||
SCRIPT
|
||||
end
|
||||
|
||||
def ember_all(typeKey)
|
||||
h = page.evaluate_script <<-SCRIPT
|
||||
$s = App.__container__.lookup('store:main');
|
||||
$s.all('#{typeKey}').invoke('serialize')
|
||||
SCRIPT
|
||||
end
|
||||
|
||||
def js_path
|
||||
page.evaluate_script 'location.pathname + location.hash'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user