{"action":"created","issue":{"url":"https://api.github.com/repos/wit-ai/node-wit/issues/4","labels_url":"https://api.github.com/repos/wit-ai/node-wit/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/wit-ai/node-wit/issues/4/comments","events_url":"https://api.github.com/repos/wit-ai/node-wit/issues/4/events","html_url":"https://github.com/wit-ai/node-wit/pull/4","id":63341588,"number":4,"title":"Add [options] param.","user":{"login":"irfaan","id":1435018,"avatar_url":"https://avatars.githubusercontent.com/u/1435018?v=3","gravatar_id":"","url":"https://api.github.com/users/irfaan","html_url":"https://github.com/irfaan","followers_url":"https://api.github.com/users/irfaan/followers","following_url":"https://api.github.com/users/irfaan/following{/other_user}","gists_url":"https://api.github.com/users/irfaan/gists{/gist_id}","starred_url":"https://api.github.com/users/irfaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irfaan/subscriptions","organizations_url":"https://api.github.com/users/irfaan/orgs","repos_url":"https://api.github.com/users/irfaan/repos","events_url":"https://api.github.com/users/irfaan/events{/privacy}","received_events_url":"https://api.github.com/users/irfaan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-21T01:06:06Z","updated_at":"2015-03-23T15:55:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wit-ai/node-wit/pulls/4","html_url":"https://github.com/wit-ai/node-wit/pull/4","diff_url":"https://github.com/wit-ai/node-wit/pull/4.diff","patch_url":"https://github.com/wit-ai/node-wit/pull/4.patch"},"body":"Options param added to captureTextIntent + captureSpeechIntent calls.\r\n\r\nDocs would also need to be updated accordingly."},"comment":{"url":"https://api.github.com/repos/wit-ai/node-wit/issues/comments/85062548","html_url":"https://github.com/wit-ai/node-wit/pull/4#issuecomment-85062548","issue_url":"https://api.github.com/repos/wit-ai/node-wit/issues/4","id":85062548,"user":{"login":"oliviervaussy","id":3935820,"avatar_url":"https://avatars.githubusercontent.com/u/3935820?v=3","gravatar_id":"","url":"https://api.github.com/users/oliviervaussy","html_url":"https://github.com/oliviervaussy","followers_url":"https://api.github.com/users/oliviervaussy/followers","following_url":"https://api.github.com/users/oliviervaussy/following{/other_user}","gists_url":"https://api.github.com/users/oliviervaussy/gists{/gist_id}","starred_url":"https://api.github.com/users/oliviervaussy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliviervaussy/subscriptions","organizations_url":"https://api.github.com/users/oliviervaussy/orgs","repos_url":"https://api.github.com/users/oliviervaussy/repos","events_url":"https://api.github.com/users/oliviervaussy/events{/privacy}","received_events_url":"https://api.github.com/users/oliviervaussy/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T15:55:31Z","updated_at":"2015-03-23T15:55:31Z","body":"For the test something like that should work :+1: \r\n\r\n```node\r\n        it('should send options as given in parameter', function (done) {\r\n            var scope = nock('https://api.wit.ai/', {\r\n                reqheaders: {\r\n                    'Authorization': 'Bearer 1234',\r\n                    'Accept': 'application/vnd.wit.20150306'\r\n                }\r\n            }).get('/message?q=set%20alarm%20tomorrow%20at%205pm&context%5Bverbose%5D=true&context%5Bcontext%5D%5Btest%5D=1')\r\n                .reply(200, wit_response);\r\n            wit.captureTextIntent(\"1234\", \"set alarm tomorrow at 5pm\", {\"verbose\": true, \"context\": {\"test\" : \"1\"}},function (err, res) {\r\n                assert.isNull(err, \"error should be undefined\");\r\n                assert.deepEqual(res, wit_response);\r\n                scope.done();\r\n                done();\r\n            });\r\n        });\r\n```\r\n\r\nThe assertion is done using nock, here we assert that the url for the request is the one defined in the .get('<URL>') function, so if you add the options it will check that your code is actually adding those options to the request. You can of course add different test: test with undefined options, test with empty object options etc... But the basic test should be something like the one above. \r\n\r\nYou can add the same kind of test for the speech function as well.\r\n\r\nAfter that your diff will be good to merge, thanks a lot for your help"}}