Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(238)

Delta Between Two Patch Sets: test/test_model.js

Issue 13997043: Remove DB.units list
Left Patch Set: Remove DB.units list Created 11 years, 6 months ago
Right Patch Set: Remove DB.units list Created 11 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/test_landscape.js ('k') | test/test_model_handlers.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 This file is part of the Juju GUI, which lets users view and manage Juju 2 This file is part of the Juju GUI, which lets users view and manage Juju
3 environments within a graphical interface (https://launchpad.net/juju-gui). 3 environments within a graphical interface (https://launchpad.net/juju-gui).
4 Copyright (C) 2012-2013 Canonical Ltd. 4 Copyright (C) 2012-2013 Canonical Ltd.
5 5
6 This program is free software: you can redistribute it and/or modify it under 6 This program is free software: you can redistribute it and/or modify it under
7 the terms of the GNU Affero General Public License version 3, as published by 7 the terms of the GNU Affero General Public License version 3, as published by
8 the Free Software Foundation. 8 the Free Software Foundation.
9 9
10 This program is distributed in the hope that it will be useful, but WITHOUT 10 This program is distributed in the hope that it will be useful, but WITHOUT
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 var data, instance, models, origData, relatedData, sampleData, utils, Y; 577 var data, instance, models, origData, relatedData, sampleData, utils, Y;
578 578
579 before(function(done) { 579 before(function(done) {
580 Y = YUI(GlobalConfig).use([ 580 Y = YUI(GlobalConfig).use([
581 'io', 581 'io',
582 'juju-charm-models', 582 'juju-charm-models',
583 'juju-tests-utils' 583 'juju-tests-utils'
584 ], function(Y) { 584 ], function(Y) {
585 models = Y.namespace('juju.models'); 585 models = Y.namespace('juju.models');
586 utils = Y.namespace('juju-tests.utils'); 586 utils = Y.namespace('juju-tests.utils');
587 done();
588 587
589 sampleData = Y.io('data/browsercharm.json', {sync: true}); 588 sampleData = Y.io('data/browsercharm.json', {sync: true});
590 origData = Y.JSON.parse(sampleData.responseText); 589 origData = Y.JSON.parse(sampleData.responseText);
591 // relatedData is never mutated so it can be used directly. 590 // relatedData is never mutated so it can be used directly.
592 relatedData = utils.loadFixture('data/related.json', true).result; 591 relatedData = utils.loadFixture('data/related.json', true).result;
592 done();
593 }); 593 });
594 }); 594 });
595 595
596 beforeEach(function() { 596 beforeEach(function() {
597 data = Y.clone(origData); 597 data = Y.clone(origData);
598 }); 598 });
599 599
600 afterEach(function() { 600 afterEach(function() {
601 if (instance) { 601 if (instance) {
602 instance.destroy(); 602 instance.destroy();
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 assert.isFalse(mysql.hasErrors(), mysql.get('id')); 875 assert.isFalse(mysql.hasErrors(), mysql.get('id'));
876 }); 876 });
877 877
878 it('can be filtered so that it returns only visible models', function() { 878 it('can be filtered so that it returns only visible models', function() {
879 var filtered = list.visible(); 879 var filtered = list.visible();
880 assert.strictEqual(2, filtered.size()); 880 assert.strictEqual(2, filtered.size());
881 assert.deepEqual([django, wordpress], filtered.toArray()); 881 assert.deepEqual([django, wordpress], filtered.toArray());
882 }); 882 });
883 }); 883 });
884 }); 884 });
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b