Last active
August 29, 2015 14:05
-
-
Save mcranston18/c14bffa5caa3a5398fa5 to your computer and use it in GitHub Desktop.
Sample Angular Test
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('PhotoCtrl', function() { | |
var ctrl, rootScope, scope, q, Mock; | |
beforeEach(angular.mock.module('app.photo', 'ui.router')); | |
beforeEach(inject(function($controller, _$rootScope_, _$location_, _$state_, _$q_) { | |
rootScope = _$rootScope_; | |
scope = rootScope.$new(); | |
q = _$q_; | |
state = _$state_; | |
// Mocks | |
Mock = { | |
PhotoService: { | |
apiMapping: { | |
returnStatus: function() { } | |
} | |
}, | |
UserService: {}, | |
AuthService: {}, | |
getPhoto: { | |
id: 'bkdzv0l28hj6r24frmyy', | |
embed_url: 'http://www.vandelayindustries.com' | |
} | |
}; | |
ctrl = $controller('PhotoCtrl', { | |
$rootScope: rootScope, | |
$scope: scope, | |
$location: _$location_, | |
state = _$state_, | |
AuthService: Mock.AuthService, | |
PhotoService: Mock.PhotoService, | |
UserService: Mock.UserService, | |
getPhoto: Mock.getPhoto | |
}); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment