Skip to content

Commit

Permalink
Add failing test for normalizeErrors introduced in PR emberjs#2392
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Bourassa committed Apr 21, 2015
1 parent d84dabe commit 692febe
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,18 @@ test("extractPolymorphic does not break hasMany relationships", function() {
"evilMinions": []
});
});

test('extractErrors extracts polymorphic records errors', function() {
var errorsPayload = {
errors: {
evil_minions: [
{ name: ['required'] }
]
}
};

var serializer = env.container.lookup('serializer:application');
serializer.extractErrors(env.store, MediocreVillain, errorsPayload, null); // id (last param) is not relevant here

ok(true);
});

0 comments on commit 692febe

Please sign in to comment.