2016-08-13 3 views

답변

1

피사체 (컨트롤러)의 target를 지정하고하자 당신의 targetactionNameactions 객체 선언 :

import { moduleFor, test } from 'ember-qunit'; 

moduleFor('controller:my-controller'); 

test('it fires an action', function(assert) { 
    let controller = this.subject(); 

    controller.set('target', Ember.Controller.extend({ 
    actions: { 
     actionName:() => assert.ok(true, 'Action bubbled!') 
    } 
    }).create()); 

    controller.send('doSomething'); 
}); 

Working demo.

+0

, 감사합니다! – lordofthefobs