More spec fixing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module SpecEmberHelpers
|
||||
def ember_store
|
||||
h = page.evaluate_script <<-SCRIPT
|
||||
$s = App.__container__.lookup('controller:application').store;
|
||||
$s = App.__container__.lookup('store:main');
|
||||
JSON.stringify({
|
||||
lists: $s.all('list').invoke('serialize'),
|
||||
orders: $s.all('order').invoke('serialize'),
|
||||
@@ -15,6 +15,14 @@ module SpecEmberHelpers
|
||||
JSON.parse(h)
|
||||
end
|
||||
|
||||
def ember_find(typeKey, id)
|
||||
h = page.evaluate_script <<-SCRIPT
|
||||
$s = App.__container__.lookup('store:main');
|
||||
record = $s.all('#{typeKey}').findBy('id', '#{id}');
|
||||
record ? record.serialize() : null
|
||||
SCRIPT
|
||||
end
|
||||
|
||||
def js_path
|
||||
page.evaluate_script 'location.pathname + location.hash'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user