mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-15 04:21:49 -05:00
Merge pull request #106 from jaredevantabor/scan-job-templates
Scan job templates
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import jobTemplates from 'tower/job-templates/main';
|
||||
import {describeModule} from '../describe-module';
|
||||
|
||||
describeModule(jobTemplates.name)
|
||||
.testService('deleteJobTemplate', function(test, restStub) {
|
||||
|
||||
var service;
|
||||
|
||||
test.withService(function(_service) {
|
||||
service = _service;
|
||||
});
|
||||
|
||||
it('deletes the job template', function() {
|
||||
var result = {};
|
||||
|
||||
var actual = service();
|
||||
|
||||
restStub.succeedOn('destroy', result);
|
||||
restStub.flush();
|
||||
|
||||
expect(actual).to.eventually.equal(result);
|
||||
|
||||
});
|
||||
});
|
||||
@@ -35,10 +35,19 @@ RestStub.prototype =
|
||||
|
||||
return this.deferred.promise;
|
||||
},
|
||||
destroy: function() {
|
||||
this.deferred = this.deferred || {};
|
||||
this.deferred.destroy = this[this.currentUrl];
|
||||
|
||||
return this.deferred.destroy.promise;
|
||||
},
|
||||
succeedAt: function(url, value) {
|
||||
assertUrlDeferred(url, this);
|
||||
this[url].resolve(value);
|
||||
},
|
||||
succeedOn: function(method, value) {
|
||||
this.deferred[method] = value;
|
||||
},
|
||||
succeed: function(value) {
|
||||
this.deferred.resolve(value);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user