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()
.
This rule warns about any usage of the currentRouteName()
test helper.
Examples of incorrect code for this rule:
assert.equal(currentRouteName(), 'foo');
Examples of correct code for this rule:
assert.equal(currentURL(), '/foo');
- Replace
currentRouteName()
withcurrentURL()
and adjust the assertion expectations
- currentRouteName() documentation
- currentURL() documentation