Last active
December 21, 2015 19:58
-
-
Save sdornan/6357515 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 require to load any .js file available to the asset pipeline | |
#= require jquery | |
#= require controllers | |
#= require angular-mocks | |
describe "App controllers", -> | |
$httpBackend | |
beforeEach inject ($injector) -> | |
$httpBackend = $injector.get('$httpBackend') | |
$rootScope = $injector.get('$rootScope') | |
$controller = $injector.get('$controller') | |
afterEach -> | |
$httpBackend.verifyNoOutstandingExpectation() | |
$httpBackend.verifyNoOutstandingRequest() | |
describe 'HomeCtrl', -> | |
beforeEach -> | |
$httpBackend.when('GET', 'api/2/queue').respond([{title: 'The Kitchen'}, | |
{title: 'The Lady Iron Chef'}]) | |
it "should fetch the user's queue", inject -> | |
$httpBackend.expectGET('api/2/queue') | |
controller = $controller('HomeCtrl', {'$scope': $rootScope}) | |
$httpBackend.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment