Skip to content

Instantly share code, notes, and snippets.

@sdornan
Created August 27, 2013 19:08
Show Gist options
  • Save sdornan/6357713 to your computer and use it in GitHub Desktop.
Save sdornan/6357713 to your computer and use it in GitHub Desktop.
# use require to load any .js file available to the asset pipeline
#= require jquery
#= require sony/sony
#= require angular-mocks
describe 'HomeCtrl', ->
$httpBackend
beforeEach inject ($injector) ->
$httpBackend = $injector.get('$httpBackend')
$rootScope = $injector.get('$rootScope')
$controller = $injector.get('$controller')
$httpBackend.when('GET', '/api/2/queue').respond([{title: 'The Kitchen'},
{title: 'The Lady Iron Chef'}])
afterEach ->
$httpBackend.verifyNoOutstandingExpectation()
$httpBackend.verifyNoOutstandingRequest()
it "should fetch the user's queue", ->
$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