Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix test warnings
Browse files Browse the repository at this point in the history
- fix ember-data complex default value returning in post model
- fix mirage returning a user of id 'me' from /user/me
  • Loading branch information
acburdine committed Jan 13, 2017
1 parent f110a97 commit 138e30d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/post.js
Expand Up @@ -72,7 +72,7 @@ export default Model.extend(Comparable, ValidationEngine, {
title: attr('string', {defaultValue: ''}),
slug: attr('string'),
markdown: attr('string', {defaultValue: ''}),
mobiledoc: attr('json-string', {defaultValue: BLANK_DOC}),
mobiledoc: attr('json-string', {defaultValue: () => BLANK_DOC}),
html: attr('string'),
image: attr('string'),
featured: attr('boolean', {defaultValue: false}),
Expand Down
6 changes: 5 additions & 1 deletion mirage/config/users.js
@@ -1,7 +1,11 @@
export default function mockUsers(server) {
// /users/me = Always return the user with ID=1
server.get('/users/me/', function ({users}) {
return users.find(1);
let user = users.find(1);

user.id = 'me';

return user;
});

server.get('/users/');
Expand Down

0 comments on commit 138e30d

Please sign in to comment.