{"action":"created","comment":{"url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/comments/70281507","id":70281507,"diff_hunk":"@@ -1,23 +1,60 @@\n const chai = require('chai');\n const expect = chai.expect;\n-const syndicationParser = require('../../app/lib/gpDetailsParser');\n+const Verror = require('verror');\n+const AssertionError = require('assert').AssertionError;\n+const gpDetailsParser = require('../../app/lib/gpDetailsParser');\n const getSampleResponse = require('./lib/getSampleResponse');\n \n-describe('Utilities', () => {\n-  describe('gpDetailsParser', () => {\n-    it('should get GP details from syndication response', () => {\n-      const syndicationXml = getSampleResponse('gp_practice_by_ods_code');\n-      const gpDetails = syndicationParser(syndicationXml);\n-      expect(gpDetails.name).to.equal('A Ditri');\n-      expect(gpDetails.address).to.eql(\n-        {\n-          line1: 'Chesser Surgery',\n-          line2: '121 Wrythe Lane',\n-          line3: 'Carshalton',\n-          line4: 'Surrey',\n-          postcode: 'SM5 2RT',\n-        });\n-      expect(gpDetails.overviewLink).to.equal('http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/14500/overview.xml?apikey=secret');\n-    });\n+describe('gpDetailsParser', () => {\n+  it('should get GP details from valid syndication response', () => {\n+    const syndicationXml = getSampleResponse('gp_practice_by_ods_code');\n+    const gpDetails = gpDetailsParser(syndicationXml);\n+    expect(gpDetails.name).to.equal('A Ditri');\n+    expect(gpDetails.address).to.eql(\n+      {\n+        line1: 'Chesser Surgery',\n+        line2: '121 Wrythe Lane',\n+        line3: 'Carshalton',\n+        line4: 'Surrey',\n+        postcode: 'SM5 2RT',\n+      });\n+    expect(gpDetails.overviewLink)\n+      .to.equal('http://v1.syndication.nhschoices.nhs.uk/organisations/gppractices/14500/overview.xml?apikey=secret');\n+  });\n+  it('should throw exception when passed invalid XML', () => {","path":"test/unit/gpDetailsParser.js","position":41,"original_position":41,"commit_id":"973389e4dcecbf08174366db88cf92376bd62ca8","original_commit_id":"973389e4dcecbf08174366db88cf92376bd62ca8","user":{"login":"st3v3nhunt","id":639706,"avatar_url":"https://avatars.githubusercontent.com/u/639706?v=3","gravatar_id":"","url":"https://api.github.com/users/st3v3nhunt","html_url":"https://github.com/st3v3nhunt","followers_url":"https://api.github.com/users/st3v3nhunt/followers","following_url":"https://api.github.com/users/st3v3nhunt/following{/other_user}","gists_url":"https://api.github.com/users/st3v3nhunt/gists{/gist_id}","starred_url":"https://api.github.com/users/st3v3nhunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/st3v3nhunt/subscriptions","organizations_url":"https://api.github.com/users/st3v3nhunt/orgs","repos_url":"https://api.github.com/users/st3v3nhunt/repos","events_url":"https://api.github.com/users/st3v3nhunt/events{/privacy}","received_events_url":"https://api.github.com/users/st3v3nhunt/received_events","type":"User","site_admin":false},"body":"Could the tests for exceptions be wrapped in their own `describe` block? I would be find it easier to identify what is doing what and it would help with code folding.","created_at":"2016-07-11T15:35:42Z","updated_at":"2016-07-11T15:35:42Z","html_url":"https://github.com/nhsalpha/gp-to-services/pull/77#discussion_r70281507","pull_request_url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/comments/70281507"},"html":{"href":"https://github.com/nhsalpha/gp-to-services/pull/77#discussion_r70281507"},"pull_request":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77","id":76967871,"html_url":"https://github.com/nhsalpha/gp-to-services/pull/77","diff_url":"https://github.com/nhsalpha/gp-to-services/pull/77.diff","patch_url":"https://github.com/nhsalpha/gp-to-services/pull/77.patch","issue_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/77","number":77,"state":"open","locked":false,"title":":mag: Add validation on GP details parsing","user":{"login":"neilbmclaughlin","id":212582,"avatar_url":"https://avatars.githubusercontent.com/u/212582?v=3","gravatar_id":"","url":"https://api.github.com/users/neilbmclaughlin","html_url":"https://github.com/neilbmclaughlin","followers_url":"https://api.github.com/users/neilbmclaughlin/followers","following_url":"https://api.github.com/users/neilbmclaughlin/following{/other_user}","gists_url":"https://api.github.com/users/neilbmclaughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/neilbmclaughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilbmclaughlin/subscriptions","organizations_url":"https://api.github.com/users/neilbmclaughlin/orgs","repos_url":"https://api.github.com/users/neilbmclaughlin/repos","events_url":"https://api.github.com/users/neilbmclaughlin/events{/privacy}","received_events_url":"https://api.github.com/users/neilbmclaughlin/received_events","type":"User","site_admin":false},"body":"Error handling and tests for gpDetailsParser","created_at":"2016-07-11T14:54:41Z","updated_at":"2016-07-11T15:35:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6513d20dc3520e0ffa7e78980a812581a5f7bf59","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77/commits","review_comments_url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77/comments","review_comment_url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/77/comments","statuses_url":"https://api.github.com/repos/nhsalpha/gp-to-services/statuses/973389e4dcecbf08174366db88cf92376bd62ca8","head":{"label":"nhsalpha:feature/xml-parse-error-handling","ref":"feature/xml-parse-error-handling","sha":"973389e4dcecbf08174366db88cf92376bd62ca8","user":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"repo":{"id":59567710,"name":"gp-to-services","full_name":"nhsalpha/gp-to-services","owner":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nhsalpha/gp-to-services","description":"Connecting the user journey from GP details to services","fork":false,"url":"https://api.github.com/repos/nhsalpha/gp-to-services","forks_url":"https://api.github.com/repos/nhsalpha/gp-to-services/forks","keys_url":"https://api.github.com/repos/nhsalpha/gp-to-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhsalpha/gp-to-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhsalpha/gp-to-services/teams","hooks_url":"https://api.github.com/repos/nhsalpha/gp-to-services/hooks","issue_events_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/events{/number}","events_url":"https://api.github.com/repos/nhsalpha/gp-to-services/events","assignees_url":"https://api.github.com/repos/nhsalpha/gp-to-services/assignees{/user}","branches_url":"https://api.github.com/repos/nhsalpha/gp-to-services/branches{/branch}","tags_url":"https://api.github.com/repos/nhsalpha/gp-to-services/tags","blobs_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhsalpha/gp-to-services/statuses/{sha}","languages_url":"https://api.github.com/repos/nhsalpha/gp-to-services/languages","stargazers_url":"https://api.github.com/repos/nhsalpha/gp-to-services/stargazers","contributors_url":"https://api.github.com/repos/nhsalpha/gp-to-services/contributors","subscribers_url":"https://api.github.com/repos/nhsalpha/gp-to-services/subscribers","subscription_url":"https://api.github.com/repos/nhsalpha/gp-to-services/subscription","commits_url":"https://api.github.com/repos/nhsalpha/gp-to-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhsalpha/gp-to-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhsalpha/gp-to-services/contents/{+path}","compare_url":"https://api.github.com/repos/nhsalpha/gp-to-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhsalpha/gp-to-services/merges","archive_url":"https://api.github.com/repos/nhsalpha/gp-to-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhsalpha/gp-to-services/downloads","issues_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues{/number}","pulls_url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls{/number}","milestones_url":"https://api.github.com/repos/nhsalpha/gp-to-services/milestones{/number}","notifications_url":"https://api.github.com/repos/nhsalpha/gp-to-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhsalpha/gp-to-services/labels{/name}","releases_url":"https://api.github.com/repos/nhsalpha/gp-to-services/releases{/id}","deployments_url":"https://api.github.com/repos/nhsalpha/gp-to-services/deployments","created_at":"2016-05-24T11:36:16Z","updated_at":"2016-05-24T14:05:55Z","pushed_at":"2016-07-11T14:54:42Z","git_url":"git://github.com/nhsalpha/gp-to-services.git","ssh_url":"git@github.com:nhsalpha/gp-to-services.git","clone_url":"https://github.com/nhsalpha/gp-to-services.git","svn_url":"https://github.com/nhsalpha/gp-to-services","homepage":null,"size":292,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"nhsalpha:master","ref":"master","sha":"060cc125fad76881d301e93ea26913d132ca71a4","user":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"repo":{"id":59567710,"name":"gp-to-services","full_name":"nhsalpha/gp-to-services","owner":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nhsalpha/gp-to-services","description":"Connecting the user journey from GP details to services","fork":false,"url":"https://api.github.com/repos/nhsalpha/gp-to-services","forks_url":"https://api.github.com/repos/nhsalpha/gp-to-services/forks","keys_url":"https://api.github.com/repos/nhsalpha/gp-to-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhsalpha/gp-to-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhsalpha/gp-to-services/teams","hooks_url":"https://api.github.com/repos/nhsalpha/gp-to-services/hooks","issue_events_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/events{/number}","events_url":"https://api.github.com/repos/nhsalpha/gp-to-services/events","assignees_url":"https://api.github.com/repos/nhsalpha/gp-to-services/assignees{/user}","branches_url":"https://api.github.com/repos/nhsalpha/gp-to-services/branches{/branch}","tags_url":"https://api.github.com/repos/nhsalpha/gp-to-services/tags","blobs_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhsalpha/gp-to-services/statuses/{sha}","languages_url":"https://api.github.com/repos/nhsalpha/gp-to-services/languages","stargazers_url":"https://api.github.com/repos/nhsalpha/gp-to-services/stargazers","contributors_url":"https://api.github.com/repos/nhsalpha/gp-to-services/contributors","subscribers_url":"https://api.github.com/repos/nhsalpha/gp-to-services/subscribers","subscription_url":"https://api.github.com/repos/nhsalpha/gp-to-services/subscription","commits_url":"https://api.github.com/repos/nhsalpha/gp-to-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhsalpha/gp-to-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhsalpha/gp-to-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhsalpha/gp-to-services/contents/{+path}","compare_url":"https://api.github.com/repos/nhsalpha/gp-to-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhsalpha/gp-to-services/merges","archive_url":"https://api.github.com/repos/nhsalpha/gp-to-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhsalpha/gp-to-services/downloads","issues_url":"https://api.github.com/repos/nhsalpha/gp-to-services/issues{/number}","pulls_url":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls{/number}","milestones_url":"https://api.github.com/repos/nhsalpha/gp-to-services/milestones{/number}","notifications_url":"https://api.github.com/repos/nhsalpha/gp-to-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhsalpha/gp-to-services/labels{/name}","releases_url":"https://api.github.com/repos/nhsalpha/gp-to-services/releases{/id}","deployments_url":"https://api.github.com/repos/nhsalpha/gp-to-services/deployments","created_at":"2016-05-24T11:36:16Z","updated_at":"2016-05-24T14:05:55Z","pushed_at":"2016-07-11T14:54:42Z","git_url":"git://github.com/nhsalpha/gp-to-services.git","ssh_url":"git@github.com:nhsalpha/gp-to-services.git","clone_url":"https://github.com/nhsalpha/gp-to-services.git","svn_url":"https://github.com/nhsalpha/gp-to-services","homepage":null,"size":292,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77"},"html":{"href":"https://github.com/nhsalpha/gp-to-services/pull/77"},"issue":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/77"},"comments":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/nhsalpha/gp-to-services/statuses/973389e4dcecbf08174366db88cf92376bd62ca8"}}}}
{"actor":{"display_login":"st3v3nhunt"}}