I prefer using something like mockjax to mock the api endpoints, then using qunit and the built in helpers provided by Ember and qunit
Here's an example of how to set up a simple json response
$.mockjax({
url: '/colors',
dataType: 'json',
responseText: {
colors:[
{
id: 1,
color: "red"
},
{
id: 2,
color: "green"
},
{
id: 3,
color: "blue"
}
]
}
});
And a test that would hit this endpoint
test("root lists 3 colors", function(){
var store = App.__container__.lookup('store:main');
var colors = store.find('color');
stop();
colors.then(function(arr){
start();
equal(arr.get('length'), 3, 'store returns 3 records');
});
});