~teknico/juju-gui/1169511-use-nsrouter-in-navigateTo

« back to all changes in this revision

Viewing changes to test/test_fakebackend.js

  • Committer: Nicola Larosa
  • Date: 2013-04-17 09:39:47 UTC
  • mfrom: (557.2.8 juju-gui)
  • Revision ID: nicola.larosa@canonical.com-20130417093947-gs28a31f2ci4xcod
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
  describe('FakeBackend.deploy', function() {
46
46
    var requires = [
47
47
      'node', 'juju-tests-utils', 'juju-models', 'juju-charm-models'];
48
 
    var Y, fakebackend, utils, setCharm, result, callback;
 
48
    var Y, fakebackend, utils, result, callback;
49
49
 
50
50
    before(function(done) {
51
51
      Y = YUI(GlobalConfig).use(requires, function(Y) {
55
55
    });
56
56
 
57
57
    beforeEach(function() {
58
 
      var setupData = utils.makeFakeBackendWithCharmStore();
59
 
      fakebackend = setupData.fakebackend;
60
 
      setCharm = setupData.setCharm;
 
58
      fakebackend = utils.makeFakeBackendWithCharmStore();
61
59
      result = undefined;
62
60
      callback = function(response) { result = response; };
63
61
    });
229
227
  describe('FakeBackend.uniformOperations', function() {
230
228
    var requires = [
231
229
      'node', 'juju-tests-utils', 'juju-models', 'juju-charm-models'];
232
 
    var Y, fakebackend, utils, setCharm;
 
230
    var Y, fakebackend, utils;
233
231
 
234
232
    before(function(done) {
235
233
      Y = YUI(GlobalConfig).use(requires, function(Y) {
239
237
    });
240
238
 
241
239
    beforeEach(function() {
242
 
      var setupData = utils.makeFakeBackendWithCharmStore();
243
 
      fakebackend = setupData.fakebackend;
244
 
      setCharm = setupData.setCharm;
 
240
      fakebackend = utils.makeFakeBackendWithCharmStore();
245
241
    });
246
242
 
247
243
    afterEach(function() {
286
282
          done();
287
283
        });
288
284
      });
 
285
 
 
286
      it('loads subordinate charms properly', function(done) {
 
287
        fakebackend.getCharm('cs:puppet', function(data) {
 
288
          assert.equal(data.result.name, 'puppet');
 
289
          assert.isTrue(data.result.is_subordinate);
 
290
          done();
 
291
        });
 
292
      });
289
293
    });
290
294
 
291
295
    describe('FakeBackend.getService', function() {
534
538
  describe('FakeBackend.addUnit', function() {
535
539
    var requires = [
536
540
      'node', 'juju-tests-utils', 'juju-models', 'juju-charm-models'];
537
 
    var Y, fakebackend, utils, setCharm, deployResult, callback;
 
541
    var Y, fakebackend, utils, deployResult, callback;
538
542
 
539
543
    before(function(done) {
540
544
      Y = YUI(GlobalConfig).use(requires, function(Y) {
544
548
    });
545
549
 
546
550
    beforeEach(function() {
547
 
      var setupData = utils.makeFakeBackendWithCharmStore();
548
 
      fakebackend = setupData.fakebackend;
549
 
      setCharm = setupData.setCharm;
 
551
      fakebackend = utils.makeFakeBackendWithCharmStore();
550
552
      deployResult = undefined;
551
553
      callback = function(response) { deployResult = response; };
552
554
    });
629
631
  describe('FakeBackend.next*', function() {
630
632
    var requires = [
631
633
      'node', 'juju-tests-utils', 'juju-models', 'juju-charm-models'];
632
 
    var Y, fakebackend, utils, setCharm, deployResult, callback;
 
634
    var Y, fakebackend, utils, deployResult, callback;
633
635
 
634
636
    before(function(done) {
635
637
      Y = YUI(GlobalConfig).use(requires, function(Y) {
639
641
    });
640
642
 
641
643
    beforeEach(function() {
642
 
      var setupData = utils.makeFakeBackendWithCharmStore();
643
 
      fakebackend = setupData.fakebackend;
644
 
      setCharm = setupData.setCharm;
 
644
      fakebackend = utils.makeFakeBackendWithCharmStore();
645
645
      deployResult = undefined;
646
646
      callback = function(response) { deployResult = response; };
647
647
    });
755
755
  describe('FakeBackend.addRelation', function() {
756
756
    var requires = [
757
757
      'node', 'juju-tests-utils', 'juju-models', 'juju-charm-models'];
758
 
    var Y, fakebackend, utils, setCharm, deployResult, callback;
 
758
    var Y, fakebackend, utils, deployResult, callback;
759
759
 
760
760
    before(function(done) {
761
761
      Y = YUI(GlobalConfig).use(requires, function(Y) {
765
765
    });
766
766
 
767
767
    beforeEach(function() {
768
 
      var setupData = utils.makeFakeBackendWithCharmStore();
769
 
      fakebackend = setupData.fakebackend;
770
 
      setCharm = setupData.setCharm;
 
768
      fakebackend = utils.makeFakeBackendWithCharmStore();
771
769
      deployResult = undefined;
772
770
      callback = function(response) { deployResult = response; };
773
771
    });