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
=== modified file 'app/store/env/go.js'
--- app/store/env/go.js 2013-03-26 17:24:07 +0000
+++ app/store/env/go.js 2013-03-27 20:00:27 +0000
@@ -108,7 +108,7 @@
108 // Define the default user name for this environment. It will appear as108 // Define the default user name for this environment. It will appear as
109 // predefined value in the login mask.109 // predefined value in the login mask.
110 this.defaultUser = 'user-admin';110 this.defaultUser = 'user-admin';
111 this.on('_rpc_response', this._handleRpcResponse, this);111 this.on('_rpc_response', this._handleRpcResponse);
112 },112 },
113113
114 /**114 /**
@@ -226,9 +226,8 @@
226 this._send_rpc({226 this._send_rpc({
227 Type: 'AllWatcher',227 Type: 'AllWatcher',
228 Request: 'Next',228 Request: 'Next',
229 Params: {229 Id: this._allWatcherId,
230 Id: this._allWatcherId230 Params: {}
231 }
232 }, function(data) {231 }, function(data) {
233 if (data.Error) {232 if (data.Error) {
234 console.log('aiiiiie!'); // XXX233 console.log('aiiiiie!'); // XXX
235234
=== modified file 'test/test_env_go.js'
--- test/test_env_go.js 2013-03-26 17:24:07 +0000
+++ test/test_env_go.js 2013-03-27 20:00:27 +0000
@@ -863,9 +863,9 @@
863 msg = conn.last_message();863 msg = conn.last_message();
864 assert.equal(msg.Type, 'AllWatcher');864 assert.equal(msg.Type, 'AllWatcher');
865 assert.equal(msg.Request, 'Next');865 assert.equal(msg.Request, 'Next');
866 assert.isTrue('Id' in msg.Params);866 assert.isTrue('Id' in msg);
867 // This response is in fact to the sent _next request.867 // This response is in fact to the sent _next request.
868 assert.equal(msg.Params.Id, env._allWatcherId);868 assert.equal(msg.Id, env._allWatcherId);
869 });869 });
870870
871 it('fires "_rpc_response" message after an RPC response', function(done) {871 it('fires "_rpc_response" message after an RPC response', function(done) {
@@ -891,6 +891,11 @@
891 env._handleRpcResponse(callbackData);891 env._handleRpcResponse(callbackData);
892 });892 });
893893
894 it('the _rpc_response subscription can not have args', function() {
895 assert.equal(env.getEvent('_rpc_response')._subscribers.length, 1);
896 assert.equal(env.getEvent('_rpc_response')._subscribers.args, null);
897 });
898
894 });899 });
895900
896})();901})();

Subscribers

People subscribed via source and target branches