Acceptance tests for user
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module SpecEmberHelpers
|
||||
def ember_store
|
||||
h = page.evaluate_script <<-SCRIPT
|
||||
$s = App.__container__.lookup('store:main');
|
||||
$s = (MozoUser || App).__container__.lookup('store:main');
|
||||
JSON.stringify({
|
||||
lists: $s.all('list').invoke('serialize'),
|
||||
orders: $s.all('order').invoke('serialize'),
|
||||
@@ -85,13 +85,13 @@ module SpecEmberHelpers
|
||||
|
||||
def ember_find(typeKey, id)
|
||||
h = page.evaluate_script <<-SCRIPT
|
||||
App.__container__.lookup('store:main').all('#{typeKey}').findBy('id', '#{id}').serialize()
|
||||
(MozoUser || App).__container__.lookup('store:main').all('#{typeKey}').findBy('id', '#{id}').serialize()
|
||||
SCRIPT
|
||||
end
|
||||
|
||||
def ember_all(typeKey)
|
||||
h = page.evaluate_script <<-SCRIPT
|
||||
App.__container__.lookup('store:main').all('#{typeKey}').invoke('serialize')
|
||||
(MozoUser || App).__container__.lookup('store:main').all('#{typeKey}').invoke('serialize')
|
||||
SCRIPT
|
||||
end
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ module Features
|
||||
|
||||
def user_visit(path)
|
||||
#visit File.join("http://localhost:3/")
|
||||
visit File.join("/user#", path)
|
||||
visit File.join("/user/index.html#", path)
|
||||
end
|
||||
|
||||
def login_employee_as(email)
|
||||
|
||||
@@ -31,7 +31,7 @@ module SpecRouteHelpers
|
||||
# currentRouteName does not include model information: /list/123 => currentRouteName == 'list'
|
||||
# page.evaluate_script %|App.__container__.lookup('controller:application').get('currentRouteName')|
|
||||
# page.evaluate_script %|App.__container__.lookup('router:main').location.lastSetURL| # not working for direct path supplier#/settings
|
||||
route = page.evaluate_script(%{App.__container__ && (window.location.hash || "#/").substr(1)})
|
||||
route = page.evaluate_script(%{(MozoUser || App).__container__ && (window.location.hash || "#/").substr(1)})
|
||||
unless omit_should_raise
|
||||
def route.should(*)
|
||||
raise "Cannot call should on ember route. Use ember_route_should_be instead"
|
||||
|
||||
Reference in New Issue
Block a user