2

次のようなコントローラーアクションをテストしたい:

createNewBase: function () {

  var attributesForNewBase = this.get( 'model' ).getProperties( ... ),
      self = this,
      newBase = this.store.createRecord( ..., {

        ...

      } );

  newBase.save().then( function ( createdBase ) {

    self.send( 'setBaseOfModel', createdBase );

  }, function ( error ) {

    console.log( error );

  } );

}

問題は、ember-qunit の moduleFor を使用してこのアクションをテストすると、ストアが未定義になることです。それで、私は何をしなければならないのですか、またはそのようなテストを作成する正しい方法は何ですか?

4

1 に答える 1