Created
August 20, 2014 14:51
-
-
Save whisher/bc9ff302acd818b7632f to your computer and use it in GitHub Desktop.
This file contains 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'; | |
beforeEach(function() { | |
module('lama'); | |
module('lama.system'); | |
module('stateMock'); | |
}); | |
var $httpBackend,$state; | |
beforeEach(inject(function( _$httpBackend_, _$state_) { | |
$httpBackend = _$httpBackend_; | |
$httpBackend.when('GET', '/api/v1/user/menus',[]).respond(200,{}); | |
$httpBackend.flush(); | |
$state = _$state_; | |
$state.expectTransitionTo('home'); | |
})); | |
afterEach(function() { | |
$httpBackend.verifyNoOutstandingExpectation(); | |
$httpBackend.verifyNoOutstandingRequest(); | |
}); | |
/*(function() {*/ | |
describe('Unit test: system module', function () { | |
describe('SystemController', function () { | |
// load the controller's module | |
beforeEach(function() { | |
module('lama'); | |
module('stateMock'); | |
}); | |
var SystemController, | |
$rootScope, | |
$scope, | |
$httpBackend, | |
$state; | |
// Initialize the controller and a mock scope | |
beforeEach(inject(function ($controller, _$rootScope_, _$httpBackend_,_$state_) { | |
$rootScope = _$rootScope_; | |
$scope = _$rootScope_.$new(); | |
$httpBackend = _$httpBackend_; | |
SystemController = $controller('SystemController', { | |
$scope: $scope | |
}); | |
$state = _$state_; | |
})); | |
it('should attach a list of awesomeThings to the scope', function () { | |
// $state.expectTransitionTo('home'); | |
expect($scope.test.length).toBe(0); | |
}); | |
it('should expose some global scope', function() { | |
expect($rootScope.global).toBeTruthy(); | |
}); | |
}); | |
}); | |
/*}());*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment