{"action":"opened","issue":{"url":"https://api.github.com/repos/njb5081/SWEN-344-API/issues/24","repository_url":"https://api.github.com/repos/njb5081/SWEN-344-API","labels_url":"https://api.github.com/repos/njb5081/SWEN-344-API/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/njb5081/SWEN-344-API/issues/24/comments","events_url":"https://api.github.com/repos/njb5081/SWEN-344-API/issues/24/events","html_url":"https://github.com/njb5081/SWEN-344-API/issues/24","id":224335467,"number":24,"title":"Fix Tests that use POST","user":{"login":"David-Egan","id":22990431,"avatar_url":"https://avatars1.githubusercontent.com/u/22990431?v=3","gravatar_id":"","url":"https://api.github.com/users/David-Egan","html_url":"https://github.com/David-Egan","followers_url":"https://api.github.com/users/David-Egan/followers","following_url":"https://api.github.com/users/David-Egan/following{/other_user}","gists_url":"https://api.github.com/users/David-Egan/gists{/gist_id}","starred_url":"https://api.github.com/users/David-Egan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/David-Egan/subscriptions","organizations_url":"https://api.github.com/users/David-Egan/orgs","repos_url":"https://api.github.com/users/David-Egan/repos","events_url":"https://api.github.com/users/David-Egan/events{/privacy}","received_events_url":"https://api.github.com/users/David-Egan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-26T03:45:32Z","updated_at":"2017-04-26T03:45:32Z","closed_at":null,"body":"It seems that two changes need to be made to make existing tests work with post.\r\nFirst the content type must be set \r\n`.set('content-type', 'application/x-www-form-urlencoded')`\r\nAlso POST parameters must be send as key-value pairs \r\n`.send(first_name: \"joe\", last_name: \"testName\")`\r\n\r\nAn example for a findOrCreateAuthor test is...\r\n```\r\nchai.request(hostName)\r\n            .post(url)\r\n\t\t\t.set('content-type', 'application/x-www-form-urlencoded')\r\n            .send(postParams)\r\n            .end((err, res) => {\r\n                res.body.should.be.a('Object');\r\n\t\t\t\tres.should.have.status(201);\r\n\t\t\t\tObject.keys(res.body).should.not.be.eql(0);\r\n              done();\r\n\t\t\t});\r\n```"}}
{"actor":{"display_login":"David-Egan"}}