Skip to content

Commit

Permalink
[api] [test] fix streaming logs request along with tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Apr 19, 2012
1 parent 56f472d commit 444ac71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions node.js/lib/client/logs.js
Expand Up @@ -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);
};

//
Expand All @@ -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);
};
10 changes: 7 additions & 3 deletions node.js/test/commands/logs-test.js
Expand Up @@ -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.