Skip to content

Commit

Permalink
Added a test for findMany using the correct URL
Browse files Browse the repository at this point in the history
  • Loading branch information
igorT committed Jul 24, 2014
1 parent 1eed136 commit f7db7bc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/ember-data/tests/integration/adapter/rest_adapter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,26 @@ test("findQuery - data is normalized through custom serializers", function() {
}));
});

test("findMany - findMany uses a correct URL to access the records", function() {
Post.reopen({ comments: DS.hasMany('comment', { async: true }) });

store.push('post', { id: 1, name: "Rails is omakase", comments: [ 1, 2, 3 ] });

var post = store.getById('post', 1);
ajaxResponse({
comments: [
{ id: 1, name: "FIRST" },
{ id: 2, name: "Rails is unagi" },
{ id: 3, name: "What is omakase?" }
]
});
post.get('comments').then(async(function(comments) {
equal(passedUrl, "/comments");
deepEqual(passedHash, {data: {ids: ["1", "2", "3"]}});
}));
});


test("findMany - returning an array populates the array", function() {
Post.reopen({ comments: DS.hasMany('comment', { async: true }) });

Expand Down

0 comments on commit f7db7bc

Please sign in to comment.