mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 12:48:52 +00:00
Start tests for rootScope castEnd
This commit is contained in:
parent
ee88ed4b44
commit
88e1ec690a
1 changed files with 15 additions and 2 deletions
|
|
@ -6,6 +6,12 @@ describe('Root Controller', function() {
|
|||
beforeEach(function () {
|
||||
module(function($provide) {
|
||||
$provide.value('User', {});
|
||||
$provide.service('$templateCache', function () {
|
||||
return {
|
||||
get: function () {},
|
||||
put: function () {}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
inject(function($rootScope, $controller, _$httpBackend_, Notification) {
|
||||
|
|
@ -25,6 +31,8 @@ describe('Root Controller', function() {
|
|||
User.save = sinon.spy();
|
||||
User.sync = sinon.spy();
|
||||
|
||||
$httpBackend.whenGET(/partials/).respond();
|
||||
|
||||
ctrl = $controller('RootCtrl', {$scope: scope, User: User});
|
||||
});
|
||||
});
|
||||
|
|
@ -53,7 +61,7 @@ describe('Root Controller', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('castEnd', function(){
|
||||
describe.only('castEnd', function(){
|
||||
var task_target, type;
|
||||
|
||||
beforeEach(function(){
|
||||
|
|
@ -104,7 +112,12 @@ describe('Root Controller', function() {
|
|||
expect(spellWasCast).to.eql(true);
|
||||
});
|
||||
|
||||
it('calls cast endpoint');
|
||||
it('calls cast endpoint', function () {
|
||||
$httpBackend.expectPOST(/cast/).respond(201);
|
||||
scope.castEnd(task_target, type);
|
||||
|
||||
$httpBackend.flush();
|
||||
});
|
||||
|
||||
it('sends notification that spell was cast');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue