{"action":"created","comment":{"url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/comments/44714647","id":44714647,"diff_hunk":"@@ -0,0 +1,37 @@\n+var chai = require('chai');\n+var expect = require('chai').expect;\n+var chaihttp = require('chai-http');\n+var fs = require('fs');\n+require(__dirname + '/../server');\n+\n+chai.use(chaihttp);\n+\n+describe('the /jsonpost/ POST route', function() {\n+  it('should write a JSON file when data is sent', function(done) {\n+    chai.request('localhost:3000')\n+      .post('/jsonpost/testfile')\n+      .send('{\"test\":\"testdata\"}')\n+      .end(function(err, res) {\n+        expect(err).to.equal(null);\n+        expect(res).to.have.status(200);\n+        expect(res.text).to.equal(\"testfile.json has been written.\");\n+        done();\n+      });\n+  });\n+  it('should write the data sent in the POST request to a file', function() {\n+    var data = fs.readFileSync(__dirname + '/../data/testfile.json').toString();\n+    expect(data).to.eql('{\"test\":\"testdata\"}');\n+  });","path":"tim_mendoza/test/test_server.js","position":24,"original_position":24,"commit_id":"5aa941ee16decc5dfd021cca19c92a798bf9a943","original_commit_id":"5aa941ee16decc5dfd021cca19c92a798bf9a943","user":{"login":"RyuGuardian","id":13077199,"avatar_url":"https://avatars.githubusercontent.com/u/13077199?v=3","gravatar_id":"","url":"https://api.github.com/users/RyuGuardian","html_url":"https://github.com/RyuGuardian","followers_url":"https://api.github.com/users/RyuGuardian/followers","following_url":"https://api.github.com/users/RyuGuardian/following{/other_user}","gists_url":"https://api.github.com/users/RyuGuardian/gists{/gist_id}","starred_url":"https://api.github.com/users/RyuGuardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyuGuardian/subscriptions","organizations_url":"https://api.github.com/users/RyuGuardian/orgs","repos_url":"https://api.github.com/users/RyuGuardian/repos","events_url":"https://api.github.com/users/RyuGuardian/events{/privacy}","received_events_url":"https://api.github.com/users/RyuGuardian/received_events","type":"User","site_admin":false},"body":"In order to check that the file was written, you can just look for it in the first test. This test also relies on the first test, which makes it dependent on it.","created_at":"2015-11-12T21:08:01Z","updated_at":"2015-11-12T21:08:01Z","html_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence/pull/3#discussion_r44714647","pull_request_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/comments/44714647"},"html":{"href":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence/pull/3#discussion_r44714647"},"pull_request":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3","id":50295467,"html_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence/pull/3","diff_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence/pull/3.diff","patch_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence/pull/3.patch","issue_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues/3","number":3,"state":"open","locked":false,"title":"inital commit","user":{"login":"timmydoza","id":12685223,"avatar_url":"https://avatars.githubusercontent.com/u/12685223?v=3","gravatar_id":"","url":"https://api.github.com/users/timmydoza","html_url":"https://github.com/timmydoza","followers_url":"https://api.github.com/users/timmydoza/followers","following_url":"https://api.github.com/users/timmydoza/following{/other_user}","gists_url":"https://api.github.com/users/timmydoza/gists{/gist_id}","starred_url":"https://api.github.com/users/timmydoza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmydoza/subscriptions","organizations_url":"https://api.github.com/users/timmydoza/orgs","repos_url":"https://api.github.com/users/timmydoza/repos","events_url":"https://api.github.com/users/timmydoza/events{/privacy}","received_events_url":"https://api.github.com/users/timmydoza/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-10T19:00:04Z","updated_at":"2015-11-12T21:08:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6be0f24ba9e5b0fd9c10b5e0d496e466092fb7ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3/commits","review_comments_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3/comments","review_comment_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues/3/comments","statuses_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/statuses/5aa941ee16decc5dfd021cca19c92a798bf9a943","head":{"label":"timmydoza:master","ref":"master","sha":"5aa941ee16decc5dfd021cca19c92a798bf9a943","user":{"login":"timmydoza","id":12685223,"avatar_url":"https://avatars.githubusercontent.com/u/12685223?v=3","gravatar_id":"","url":"https://api.github.com/users/timmydoza","html_url":"https://github.com/timmydoza","followers_url":"https://api.github.com/users/timmydoza/followers","following_url":"https://api.github.com/users/timmydoza/following{/other_user}","gists_url":"https://api.github.com/users/timmydoza/gists{/gist_id}","starred_url":"https://api.github.com/users/timmydoza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmydoza/subscriptions","organizations_url":"https://api.github.com/users/timmydoza/orgs","repos_url":"https://api.github.com/users/timmydoza/repos","events_url":"https://api.github.com/users/timmydoza/events{/privacy}","received_events_url":"https://api.github.com/users/timmydoza/received_events","type":"User","site_admin":false},"repo":{"id":45933468,"name":"http_with_persistence","full_name":"timmydoza/http_with_persistence","owner":{"login":"timmydoza","id":12685223,"avatar_url":"https://avatars.githubusercontent.com/u/12685223?v=3","gravatar_id":"","url":"https://api.github.com/users/timmydoza","html_url":"https://github.com/timmydoza","followers_url":"https://api.github.com/users/timmydoza/followers","following_url":"https://api.github.com/users/timmydoza/following{/other_user}","gists_url":"https://api.github.com/users/timmydoza/gists{/gist_id}","starred_url":"https://api.github.com/users/timmydoza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmydoza/subscriptions","organizations_url":"https://api.github.com/users/timmydoza/orgs","repos_url":"https://api.github.com/users/timmydoza/repos","events_url":"https://api.github.com/users/timmydoza/events{/privacy}","received_events_url":"https://api.github.com/users/timmydoza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timmydoza/http_with_persistence","description":"","fork":true,"url":"https://api.github.com/repos/timmydoza/http_with_persistence","forks_url":"https://api.github.com/repos/timmydoza/http_with_persistence/forks","keys_url":"https://api.github.com/repos/timmydoza/http_with_persistence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timmydoza/http_with_persistence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timmydoza/http_with_persistence/teams","hooks_url":"https://api.github.com/repos/timmydoza/http_with_persistence/hooks","issue_events_url":"https://api.github.com/repos/timmydoza/http_with_persistence/issues/events{/number}","events_url":"https://api.github.com/repos/timmydoza/http_with_persistence/events","assignees_url":"https://api.github.com/repos/timmydoza/http_with_persistence/assignees{/user}","branches_url":"https://api.github.com/repos/timmydoza/http_with_persistence/branches{/branch}","tags_url":"https://api.github.com/repos/timmydoza/http_with_persistence/tags","blobs_url":"https://api.github.com/repos/timmydoza/http_with_persistence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timmydoza/http_with_persistence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timmydoza/http_with_persistence/git/refs{/sha}","trees_url":"https://api.github.com/repos/timmydoza/http_with_persistence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timmydoza/http_with_persistence/statuses/{sha}","languages_url":"https://api.github.com/repos/timmydoza/http_with_persistence/languages","stargazers_url":"https://api.github.com/repos/timmydoza/http_with_persistence/stargazers","contributors_url":"https://api.github.com/repos/timmydoza/http_with_persistence/contributors","subscribers_url":"https://api.github.com/repos/timmydoza/http_with_persistence/subscribers","subscription_url":"https://api.github.com/repos/timmydoza/http_with_persistence/subscription","commits_url":"https://api.github.com/repos/timmydoza/http_with_persistence/commits{/sha}","git_commits_url":"https://api.github.com/repos/timmydoza/http_with_persistence/git/commits{/sha}","comments_url":"https://api.github.com/repos/timmydoza/http_with_persistence/comments{/number}","issue_comment_url":"https://api.github.com/repos/timmydoza/http_with_persistence/issues/comments{/number}","contents_url":"https://api.github.com/repos/timmydoza/http_with_persistence/contents/{+path}","compare_url":"https://api.github.com/repos/timmydoza/http_with_persistence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timmydoza/http_with_persistence/merges","archive_url":"https://api.github.com/repos/timmydoza/http_with_persistence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timmydoza/http_with_persistence/downloads","issues_url":"https://api.github.com/repos/timmydoza/http_with_persistence/issues{/number}","pulls_url":"https://api.github.com/repos/timmydoza/http_with_persistence/pulls{/number}","milestones_url":"https://api.github.com/repos/timmydoza/http_with_persistence/milestones{/number}","notifications_url":"https://api.github.com/repos/timmydoza/http_with_persistence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timmydoza/http_with_persistence/labels{/name}","releases_url":"https://api.github.com/repos/timmydoza/http_with_persistence/releases{/id}","created_at":"2015-11-10T18:57:23Z","updated_at":"2015-11-10T18:59:24Z","pushed_at":"2015-11-10T18:59:24Z","git_url":"git://github.com/timmydoza/http_with_persistence.git","ssh_url":"git@github.com:timmydoza/http_with_persistence.git","clone_url":"https://github.com/timmydoza/http_with_persistence.git","svn_url":"https://github.com/timmydoza/http_with_persistence","homepage":null,"size":83,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"codefellows-sea-d45-javascript:master","ref":"master","sha":"8fed4e7a04ab34e3f35a383e99f1885214afccd2","user":{"login":"codefellows-sea-d45-javascript","id":15329994,"avatar_url":"https://avatars.githubusercontent.com/u/15329994?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-sea-d45-javascript","html_url":"https://github.com/codefellows-sea-d45-javascript","followers_url":"https://api.github.com/users/codefellows-sea-d45-javascript/followers","following_url":"https://api.github.com/users/codefellows-sea-d45-javascript/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-sea-d45-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-sea-d45-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-sea-d45-javascript/subscriptions","organizations_url":"https://api.github.com/users/codefellows-sea-d45-javascript/orgs","repos_url":"https://api.github.com/users/codefellows-sea-d45-javascript/repos","events_url":"https://api.github.com/users/codefellows-sea-d45-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-sea-d45-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":45876340,"name":"http_with_persistence","full_name":"codefellows-sea-d45-javascript/http_with_persistence","owner":{"login":"codefellows-sea-d45-javascript","id":15329994,"avatar_url":"https://avatars.githubusercontent.com/u/15329994?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-sea-d45-javascript","html_url":"https://github.com/codefellows-sea-d45-javascript","followers_url":"https://api.github.com/users/codefellows-sea-d45-javascript/followers","following_url":"https://api.github.com/users/codefellows-sea-d45-javascript/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-sea-d45-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-sea-d45-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-sea-d45-javascript/subscriptions","organizations_url":"https://api.github.com/users/codefellows-sea-d45-javascript/orgs","repos_url":"https://api.github.com/users/codefellows-sea-d45-javascript/repos","events_url":"https://api.github.com/users/codefellows-sea-d45-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-sea-d45-javascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence","description":"","fork":false,"url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence","forks_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/forks","keys_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/teams","hooks_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/hooks","issue_events_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues/events{/number}","events_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/events","assignees_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/assignees{/user}","branches_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/branches{/branch}","tags_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/tags","blobs_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/statuses/{sha}","languages_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/languages","stargazers_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/stargazers","contributors_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/contributors","subscribers_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/subscribers","subscription_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/subscription","commits_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/contents/{+path}","compare_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/merges","archive_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/downloads","issues_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues{/number}","pulls_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls{/number}","milestones_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/milestones{/number}","notifications_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/labels{/name}","releases_url":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/releases{/id}","created_at":"2015-11-10T00:24:16Z","updated_at":"2015-11-11T19:26:52Z","pushed_at":"2015-11-12T20:57:57Z","git_url":"git://github.com/codefellows-sea-d45-javascript/http_with_persistence.git","ssh_url":"git@github.com:codefellows-sea-d45-javascript/http_with_persistence.git","clone_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence.git","svn_url":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence","homepage":null,"size":629,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":18,"forks":28,"open_issues":18,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3"},"html":{"href":"https://github.com/codefellows-sea-d45-javascript/http_with_persistence/pull/3"},"issue":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues/3"},"comments":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/codefellows-sea-d45-javascript/http_with_persistence/statuses/5aa941ee16decc5dfd021cca19c92a798bf9a943"}}}}