OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 }); | 67 }); |
68 | 68 |
69 beforeEach(function(done) { | 69 beforeEach(function(done) { |
70 conn = new testUtils.SocketStub(); | 70 conn = new testUtils.SocketStub(); |
71 env = Y.namespace('juju').newEnvironment({conn: conn}); | 71 env = Y.namespace('juju').newEnvironment({conn: conn}); |
72 env.connect(); | 72 env.connect(); |
73 conn.open(); | 73 conn.open(); |
74 container = Y.Node.create('<div id="test-container" />'); | 74 container = Y.Node.create('<div id="test-container" />'); |
75 Y.one('#main').append(container); | 75 Y.one('#main').append(container); |
76 db = new models.Database(); | 76 db = new models.Database(); |
77 charm = new models.BrowserCharm({ | 77 charm = new models.Charm({ |
78 id: 'precise/mysql-7', | 78 id: 'precise/mysql-7', |
79 url: 'cs:precise/mysql-7', | 79 url: 'cs:precise/mysql-7', |
80 description: 'A DB', | 80 description: 'A DB', |
81 options: { | 81 options: { |
82 option0: { | 82 option0: { |
83 description: 'The first option.', | 83 description: 'The first option.', |
84 type: 'string' | 84 type: 'string' |
85 }, | 85 }, |
86 option1: { | 86 option1: { |
87 description: 'The second option.', | 87 description: 'The second option.', |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 assertError('floatOption', 'a', 'The value "a" is not a float.'); | 264 assertError('floatOption', 'a', 'The value "a" is not a float.'); |
265 | 265 |
266 assertError('intOptionWithDefault', ' ', null); | 266 assertError('intOptionWithDefault', ' ', null); |
267 assertError('intOptionWithDefault', '', null); | 267 assertError('intOptionWithDefault', '', null); |
268 assertError('intOptionWithDefault', '1', null); | 268 assertError('intOptionWithDefault', '1', null); |
269 assertError('intOptionWithDefault', 'a', | 269 assertError('intOptionWithDefault', 'a', |
270 'The value "a" is not an integer.'); | 270 'The value "a" is not an integer.'); |
271 }); | 271 }); |
272 }); | 272 }); |
273 })(); | 273 })(); |
OLD | NEW |