Remove references to $rootScope.Shared & .Content in non-view code.

Instead, have them request services that return them so tests don’t need to prepare special state.
This commit is contained in:
Andrew Bloomgarden
2014-01-12 15:05:15 -08:00
parent 77801e458e
commit dc368bb652
14 changed files with 65 additions and 58 deletions

View File

@@ -6,16 +6,10 @@ describe('memberServices', function() {
beforeEach(module('memberServices'));
beforeEach(module('habitrpg'));
beforeEach(function(){
inject(function(_$httpBackend_, $rootScope){
$httpBackend = _$httpBackend_;
$rootScope.Shared = window.habitrpgShared;
});
// $rootScope.Shared is set, so now we can inject Members
inject(function(Members){
members = Members;
});
});
beforeEach(inject(function (_$httpBackend_, Members) {
$httpBackend = _$httpBackend_;
members = Members;
}));
it('has no members at the beginning', function() {
expect(members.members).to.be.an('object');
@@ -43,4 +37,4 @@ describe('memberServices', function() {
expect(members.members).to.have.property(uid);
});
});
});