Skip to content

Instantly share code, notes, and snippets.

@tatey
Created July 6, 2013 09:02
Show Gist options
  • Save tatey/5939319 to your computer and use it in GitHub Desktop.
Save tatey/5939319 to your computer and use it in GitHub Desktop.
'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