lundi 29 août 2016

Acceptance test to find specific record is giving error

I'm running an acceptance test for a route, in order to find a record, but I'm getting this 2 errors on the console:

route-handler.js: Mirage: Your handler for the url /rooms/1 threw an error: Cannot read property 'find' of undefined TypeError: Cannot read property 'find' of undefined

ember.debug.js: Error while processing route: rooms.room.activity Cannot read property '_internalModel' of undefined TypeError: Cannot read property '_internalModel' of undefined

This is my acceptance test:

test('Show specific room', (assert) => {
  visit('/rooms/1/activity');
  andThen(() => {
     assert.equal( find('h1:contains(Title 1)').length, 1 );
  });
});

This is my route:

 import Ember from 'ember';

    export default Ember.Route.extend({
        model(params) {
            return this.store.findRecord('room', params.id);
        }
    });

Actually, if I do a test to verify that when visiting a route, that's the current URL, I get the same error. Could someone suggest me what could be happening or other way to solve this test?. Thanks

Aucun commentaire:

Enregistrer un commentaire