Created
July 13, 2014 14:27
-
-
Save fervisa/ddce07525409fa79187d to your computer and use it in GitHub Desktop.
specs init for angular backend mocking
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
#= require application | |
#= require angular-mocks | |
#= require support/sinon | |
#= require support/jasmine-sinon | |
beforeEach(module('demoApp')) | |
beforeEach inject (_$httpBackend_, _$compile_, $rootScope, $controller, $location, $injector, $timeout) -> | |
@scope = $rootScope.$new() | |
@http = _$httpBackend_ | |
@compile = _$compile_ | |
@location = $location | |
@controller = $controller | |
@injector = $injector | |
@timeout = $timeout | |
@model = (name) => | |
@injector.get(name) | |
@eventLoop = | |
flush: => | |
@scope.$digest() | |
@sandbox = sinon.sandbox.create() | |
afterEach -> | |
@http.resetExpectations() | |
@http.verifyNoOutstandingExpectation() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment