Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 982 Bytes

no-current-route-name.md

File metadata and controls

36 lines (23 loc) · 982 Bytes

ember/no-current-route-name

The route name is something which is not visible to the user, so it can be considered an implementation detail. The URL however is visible to the user, so when writing tests it makes much more sense to assert against currentURL() instead of currentRouteName().

Rule Details

This rule warns about any usage of the currentRouteName() test helper.

Examples

Examples of incorrect code for this rule:

assert.equal(currentRouteName(), 'foo');

Examples of correct code for this rule:

assert.equal(currentURL(), '/foo');

Migration

  • Replace currentRouteName() with currentURL() and adjust the assertion expectations

References