Fixed reload tests

This commit is contained in:
Keith Holliday
2016-05-14 11:47:01 -05:00
committed by Blade Barringer
parent 72c1729d54
commit 2d5bf9b1bc

View File

@@ -1,7 +1,7 @@
'use strict'; 'use strict';
describe('Invite to Group Controller', function() { describe('Invite to Group Controller', function() {
var scope, ctrl, groups, user, guild, $rootScope; var scope, ctrl, groups, user, guild, rootScope, $controller;
beforeEach(function() { beforeEach(function() {
user = specHelper.newUser({ user = specHelper.newUser({
@@ -13,8 +13,12 @@ describe('Invite to Group Controller', function() {
$provide.value('injectedGroup', { user: user }); $provide.value('injectedGroup', { user: user });
}); });
inject(function($rootScope, $controller, Groups){ inject(function(_$rootScope_, _$controller_, Groups) {
scope = $rootScope.$new(); rootScope = _$rootScope_;
scope = _$rootScope_.$new();
$controller = _$controller_;
// Load RootCtrl to ensure shared behaviors are loaded // Load RootCtrl to ensure shared behaviors are loaded
$controller('RootCtrl', {$scope: scope, User: {user: user}}); $controller('RootCtrl', {$scope: scope, User: {user: user}});
@@ -93,6 +97,10 @@ describe('Invite to Group Controller', function() {
}); });
context('email', function() { context('email', function() {
beforeEach(function () {
sandbox.stub(rootScope, 'hardRedirect');
});
it('invites user with emails', function(done) { it('invites user with emails', function(done) {
scope.emails = [ scope.emails = [
{name: 'Luigi', email: 'mario_bro@themushroomkingdom.com'}, {name: 'Luigi', email: 'mario_bro@themushroomkingdom.com'},
@@ -166,6 +174,10 @@ describe('Invite to Group Controller', function() {
}); });
context('uuid', function() { context('uuid', function() {
beforeEach(function () {
sandbox.stub(rootScope, 'hardRedirect');
});
it('invites user with uuid', function(done) { it('invites user with uuid', function(done) {
scope.invitees = [{uuid: '1234'}]; scope.invitees = [{uuid: '1234'}];