Question

Building my first ember app based on ember app kit.

I wanted to test the current route after transition - and found just what I need in ember docs - currentRouteName, currentURL and currentPath helper functions.

However, if I use these functions i get a "ReferencError: currentRouteName is not defined".

I stumbled upon this pull request that I suppose has the initial implementation of the same thing - but was closed in favor of adding this functionality to ember proper... For the time being, I copied the code from this PR and it does indeed get picked up and pass my tests.

Question: how can I utilize all the functions defined in my copy of ember.js in testing? These route helper functions are defined alongside with visit and click functions, which my tests seem to pick up without issue. Or, are my tests picking these functions up from somewhere else?

Was it helpful?

Solution

Those methods weren't added as global helpers until 1.5, so they are only available in the canary builds as of writing this.

http://emberjs.jsbin.com/wipo/2/edit

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top