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 May 11, 2015
1 parent 4b44728 commit 429d9eb
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,18 @@ test("extractErrors camelizes keys", function() {
firstName: ["firstName not evil enough"]
});
});

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

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

ok(true);
});

0 comments on commit 429d9eb

Please sign in to comment.