Created
March 23, 2016 18:27
-
-
Save Kerrick/87b1af7abfb103554cb2 to your computer and use it in GitHub Desktop.
Dirty Property Test Case
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
init() { | |
this._super(); | |
$.mockjax({ | |
url: '/authors/1', | |
type: 'GET', | |
responseText: { | |
author: { | |
id: 1, | |
name: 'Kerrick' | |
} | |
} | |
}); | |
$.mockjax({ | |
url: '/authors/1', | |
type: 'PUT', | |
response: function(settings) { | |
this.responseText = { | |
author: { | |
id: 1, | |
name: JSON.parse(settings.data).author.name | |
} | |
} | |
} | |
}); | |
}, | |
model() { | |
return this.store.find('author', 1); | |
}, | |
actions: { | |
save(model) { | |
model.save(); | |
} | |
} | |
}); |
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
{ | |
"version": "0.6.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "1.13.13", | |
"ember-data": "1.13.15", | |
"ember-template-compiler": "1.13.13", | |
"jquery-mockjax": "https://cdnjs.cloudflare.com/ajax/libs/jquery-mockjax/1.6.2/jquery.mockjax.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment