test(router): rename helpers in test

This commit is contained in:
Brian Ford
2015-05-13 13:03:29 -07:00
parent 88c607da03
commit 6b02cb9b44

View File

@ -43,7 +43,7 @@ export function main() {
it('should navigate based on the initial URL state', inject([AsyncTestCompleter], (async) => { it('should navigate based on the initial URL state', inject([AsyncTestCompleter], (async) => {
var outlet = makeDummyRef(); var outlet = makeDummyOutlet();
router.config({'path': '/', 'component': 'Index' }) router.config({'path': '/', 'component': 'Index' })
.then((_) => router.registerOutlet(outlet)) .then((_) => router.registerOutlet(outlet))
@ -56,7 +56,7 @@ export function main() {
it('should activate viewports and update URL on navigate', inject([AsyncTestCompleter], (async) => { it('should activate viewports and update URL on navigate', inject([AsyncTestCompleter], (async) => {
var outlet = makeDummyRef(); var outlet = makeDummyOutlet();
router.registerOutlet(outlet) router.registerOutlet(outlet)
.then((_) => { .then((_) => {
@ -71,7 +71,7 @@ export function main() {
})); }));
it('should navigate after being configured', inject([AsyncTestCompleter], (async) => { it('should navigate after being configured', inject([AsyncTestCompleter], (async) => {
var outlet = makeDummyRef(); var outlet = makeDummyOutlet();
router.registerOutlet(outlet) router.registerOutlet(outlet)
.then((_) => router.navigate('/a')) .then((_) => router.navigate('/a'))
@ -89,10 +89,10 @@ export function main() {
@proxy @proxy
@IMPLEMENTS(RouterOutlet) @IMPLEMENTS(RouterOutlet)
class DummyOutletRef extends SpyObject {noSuchMethod(m){return super.noSuchMethod(m)}} class DummyOutlet extends SpyObject {noSuchMethod(m){return super.noSuchMethod(m)}}
function makeDummyRef() { function makeDummyOutlet() {
var ref = new DummyOutletRef(); var ref = new DummyOutlet();
ref.spy('activate').andCallFake((_) => PromiseWrapper.resolve(true)); ref.spy('activate').andCallFake((_) => PromiseWrapper.resolve(true));
ref.spy('canActivate').andCallFake((_) => PromiseWrapper.resolve(true)); ref.spy('canActivate').andCallFake((_) => PromiseWrapper.resolve(true));
ref.spy('canDeactivate').andCallFake((_) => PromiseWrapper.resolve(true)); ref.spy('canDeactivate').andCallFake((_) => PromiseWrapper.resolve(true));