Created
April 29, 2014 17:28
-
-
Save Bestra/11406814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test 'Paper hasMany tasks (async)', -> | |
stop() | |
paperPromise = Ember.run => | |
task1 = @store().createRecord 'task', type: 'MessageTask', title: 'A message', isMetaData: false | |
task2 = @store().createRecord 'task', type: 'TechCheckTask', title: 'some task',isMetaData: true | |
paper = @store().createRecord 'paper', | |
title: 'some really long title' | |
shortTitle: 'test short title' | |
paper.get('tasks').then (tasks) -> | |
tasks.pushObjects [task1, task2] | |
paper | |
paperPromise.then((paper) -> | |
deepEqual paper.get('tasks').mapBy('type'), ['MessageTask', 'TechCheckTask'] | |
).then(start, start) | |
test 'allMetadata tasks filters tasks by isMetaData', -> | |
stop() | |
paperPromise = Ember.run => | |
task1 = @store().createRecord 'task', type: 'MessageTask', title: 'A message', isMetaData: false | |
task2 = @store().createRecord 'task', type: 'TechCheckTask', title: 'some task',isMetaData: true | |
paper = @store().createRecord 'paper', | |
title: 'some really long title' | |
shortTitle: 'test short title' | |
paper.get('tasks').then (tasks) -> | |
tasks.pushObjects [task1, task2] | |
paper | |
paperPromise.then((paper) -> | |
deepEqual paper.get('allMetaDataTasks').mapBy('type'), ['TechCheckTask'] | |
).then(start, start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment