Created
July 6, 2013 09:02
-
-
Save tatey/5939319 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
describe('route', function() { | |
beforeEach(function() { | |
module('route'); | |
}); | |
describe('#projectPath', function() { | |
it('replaces :org', inject(function(route) { | |
var options = {org: 'tatey'}, | |
retval = route.projectPath(options); | |
expect(retval).to.equal('/tatey/projects'); | |
})); | |
}); | |
describe('#projectEditPath', function() { | |
it('replaces :org and :id', inject(function(route) { | |
var options = {org: 'tatey', id: 42}, | |
retval = route.projectEditPath(options); | |
expect(retval).to.equal('/tatey/projects/42/edit'); | |
})); | |
}); | |
describe('#redirectTo', function() { | |
var window = {location: undefined}; | |
beforeEach(function() { | |
module(function($provide) { | |
$provide.value('$window', window); | |
}); | |
}); | |
it('sets', inject(function(route) { | |
route.redirectTo('/tatey/projects'); | |
expect(window.location).to.equal('/tatey/projects'); | |
})); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment