Created
October 24, 2014 22:36
-
-
Save jdart/8ea75117702c7ceb1166 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
angular.module('thing', ['ionic']) | |
.config(function($stateProvider, $urlRouterProvider) { | |
$stateProvider | |
.state('login', { | |
url: "/login", | |
templateUrl: "views/login.html", | |
controller: "LoginCtrl" | |
}); | |
}) | |
.factory('someFactory', function($http) { | |
return { | |
test: function() { | |
$http.get('http://google.com') | |
} | |
} | |
}); | |
describe('thing', function() { | |
var $httpBackend; | |
var someFactory; | |
beforeEach(module('thing')); | |
beforeEach(function() { | |
module(function ($provide) { | |
$provide.value('state', { | |
state: function() { return this; } | |
}); | |
}); | |
}); | |
beforeEach(inject(function(_$httpBackend_, _someFactory_) { | |
$httpBackend = _$httpBackend_; | |
someFactory = _someFactory_; | |
})); | |
afterEach(function() { | |
$httpBackend.verifyNoOutstandingExpectation(); | |
}); | |
it('anything', function(){ | |
someFactory.test(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment