Merge lp:~benji/juju-gui/1161000-fix-go-Next-arguments into lp:juju-gui/experimental

Proposed by Benji York
Status: Merged
Merged at revision: 464
Proposed branch: lp:~benji/juju-gui/1161000-fix-go-Next-arguments
Merge into: lp:juju-gui/experimental
Diff against target: 52 lines (+10/-6)
2 files modified
app/store/env/go.js (+3/-4)
test/test_env_go.js (+7/-2)
To merge this branch: bzr merge lp:~benji/juju-gui/1161000-fix-go-Next-arguments
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+155844@code.launchpad.net

Description of the change

Fix a bad event subscription and Next request args

Fixes bug 1161000.

https://codereview.appspot.com/8058043/

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :
Revision history for this message
Jeff Pihach (hatch) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/store/env/go.js'
2--- app/store/env/go.js 2013-03-26 17:24:07 +0000
3+++ app/store/env/go.js 2013-03-27 20:00:27 +0000
4@@ -108,7 +108,7 @@
5 // Define the default user name for this environment. It will appear as
6 // predefined value in the login mask.
7 this.defaultUser = 'user-admin';
8- this.on('_rpc_response', this._handleRpcResponse, this);
9+ this.on('_rpc_response', this._handleRpcResponse);
10 },
11
12 /**
13@@ -226,9 +226,8 @@
14 this._send_rpc({
15 Type: 'AllWatcher',
16 Request: 'Next',
17- Params: {
18- Id: this._allWatcherId
19- }
20+ Id: this._allWatcherId,
21+ Params: {}
22 }, function(data) {
23 if (data.Error) {
24 console.log('aiiiiie!'); // XXX
25
26=== modified file 'test/test_env_go.js'
27--- test/test_env_go.js 2013-03-26 17:24:07 +0000
28+++ test/test_env_go.js 2013-03-27 20:00:27 +0000
29@@ -863,9 +863,9 @@
30 msg = conn.last_message();
31 assert.equal(msg.Type, 'AllWatcher');
32 assert.equal(msg.Request, 'Next');
33- assert.isTrue('Id' in msg.Params);
34+ assert.isTrue('Id' in msg);
35 // This response is in fact to the sent _next request.
36- assert.equal(msg.Params.Id, env._allWatcherId);
37+ assert.equal(msg.Id, env._allWatcherId);
38 });
39
40 it('fires "_rpc_response" message after an RPC response', function(done) {
41@@ -891,6 +891,11 @@
42 env._handleRpcResponse(callbackData);
43 });
44
45+ it('the _rpc_response subscription can not have args', function() {
46+ assert.equal(env.getEvent('_rpc_response')._subscribers.length, 1);
47+ assert.equal(env.getEvent('_rpc_response')._subscribers.args, null);
48+ });
49+
50 });
51
52 })();

Subscribers

People subscribed via source and target branches