Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot test controller action that sends action to route #12588

Closed
Fryie opened this issue Nov 11, 2015 · 5 comments
Closed

Cannot test controller action that sends action to route #12588

Fryie opened this issue Nov 11, 2015 · 5 comments

Comments

@Fryie
Copy link

Fryie commented Nov 11, 2015

Basically I have a controller action that calls send, and that action should be handled in the route. I have a test for it which used to work, but after upgrading ember-mocha (which probably updated the test helpers), this doesn't work anymore. Here's a JSBin that reproduces the issue.

The issue seems to be that it's trying to look up a router somewhere which is set to undefined. I believe this is somewhere in EmberRouteror so, the compiled output of the function where the error is raised is:

  send: function (name, context) {
      var _router3;

      (_router3 = this.router).trigger.apply(_router3, arguments);
    },

edit:
Here is a version that works. It's the same, but uses different ember and ember-mocha versions.
Narrowing it down further, the problem definitely seems to have appeared between v. 0.7.0 and 0.8.0 of ember-mocha.

@rwjblue
Copy link
Member

rwjblue commented Nov 11, 2015

Work around for now (using latest version of ember-mocha): http://jsbin.com/fohomo/edit?html,js,output

@rwjblue
Copy link
Member

rwjblue commented Nov 11, 2015

We need a similar fix as what was done in #11664, but for controllers.

@locks locks added the Bug label Apr 20, 2016
@somasuna
Copy link

Is this fixed for controllers?

@pixelhandler
Copy link
Contributor

@Fryie @rwjblue is this still an issue, perhaps we should close or create a new reproduction of this, what do you think?

@pixelhandler
Copy link
Contributor

Per our triage policy I'll close this out for now, feel free to reopen if the issue persists on the current release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants