Skip to content
Permalink
Browse files

[api] [test] fix streaming logs request along with tests.

  • Loading branch information...
chjj committed Apr 19, 2012
1 parent 56f472d commit 444ac718a9367a47a246cb2f1fe34bc5762a6c7a
Showing with 9 additions and 5 deletions.
  1. +2 −2 node.js/lib/client/logs.js
  2. +7 −3 node.js/test/commands/logs-test.js
@@ -86,7 +86,7 @@ Logs.prototype.streamByApp = function (appName, stream) {
var appName = defaultUser.call(this, appName),
argv = ['logs'].concat(appName.split('/'), 'stream');

return this.stream('POST', argv, {}, stream);
return this.stream('GET', argv, null, stream);
};

//
@@ -98,5 +98,5 @@ Logs.prototype.streamByApp = function (appName, stream) {
Logs.prototype.streamByUser = function (username, stream) {
username = username || this.options.get('username');

return this.stream('POST', ['logs', username, 'stream'], {}, stream);
return this.stream('GET', ['logs', username, 'stream'], null, stream);
};
@@ -29,8 +29,12 @@ vows.describe('logs').addBatch(makeApiCall(
'logs streamByUser myUser',
function setup () {
nock('http://api.mockjitsu.com')
.post('/logs/myUser/stream', {})
.reply(200, 'here are some logs\nenjoy them.',
{ 'x-powered-by': 'Nodejitsu' })
.get('/logs/myUser/stream')
.reply(200, {
app: 'example-app',
user: 'myUser',
data: 'Testing my app.1334857998687\n',
name: 'stdout'
}, { 'x-powered-by': 'Nodejitsu' })
}
)).export(module);

0 comments on commit 444ac71

Please sign in to comment.
You can’t perform that action at this time.