Skip to content

Commit

Permalink
Added note and test cases showing withRelatedFields configuration i…
Browse files Browse the repository at this point in the history
…s not working properly
  • Loading branch information
naz committed Jan 7, 2019
1 parent 5b83d74 commit 5861c28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/test/integration/model/model_posts_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var should = require('should'),
* - using rewire is not possible, because each model self registers it's model registry in bookshelf
* - rewire would add 1 registry, a file who requires the models, tries to register the model another time
*/
describe.only('Post Model', function () {
describe('Post Model', function () {
var eventsTriggered = {};

before(testUtils.teardown);
Expand Down
6 changes: 6 additions & 0 deletions core/test/unit/services/url/Resources_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ describe('Unit: services/url/Resources', function () {
should.exist(created.posts[0].data.primary_author);
should.exist(created.posts[0].data.primary_tag);

// FIXME: these fields should correspond to configuration values in withRelatedFields
Object.keys(created.posts[0].data.primary_author).sort().should.eql(['id', 'post_id', 'slug'].sort());
Object.keys(created.posts[0].data.primary_tag).sort().should.eql(['id', 'post_id', 'slug', 'visibility'].sort());

should.exist(created.posts[1].data.primary_author);
should.exist(created.posts[1].data.primary_tag);

Expand Down Expand Up @@ -108,6 +112,8 @@ describe('Unit: services/url/Resources', function () {

should.exist(resources.getByIdAndType(options.eventData.type, options.eventData.id));
obj.tags.length.should.eql(1);

// FIXME: these fields should correspond to configuration values in withRelatedFields
Object.keys(obj.tags[0]).sort().should.eql(['id', 'post_id', 'slug', 'visibility'].sort());
obj.authors.length.should.eql(1);
Object.keys(obj.authors[0]).sort().should.eql(['id', 'post_id', 'slug'].sort());
Expand Down

0 comments on commit 5861c28

Please sign in to comment.