{"action":"created","comment":{"url":"https://api.github.com/repos/namely/connect/pulls/comments/28519955","id":28519955,"diff_hunk":"@@ -0,0 +1,65 @@\n+require \"rails_helper\"\n+\n+describe \"iCIMS new candidate\" do\n+  let(:api_host) do\n+    \"%{protocol}://%{subdomain}.namely.com\" % {\n+      protocol: Rails.configuration.namely_api_protocol,\n+      subdomain: ENV[\"TEST_NAMELY_SUBDOMAIN\"],\n+    }\n+  end\n+\n+  it \"creates new user in namely\" do\n+    stub_person_results\n+    user = create(:user)\n+    create(\n+      :icims_connection,\n+      :with_namely_field,\n+      key: \"KEY\",\n+      customer_id: 2187,\n+      user: user,\n+      username: \"USERNAME\",\n+    )\n+    stub_request(:post, \"#{api_host}/api/v1/profiles\").\n+      to_return(\n+        status: 200,\n+        body: File.read(\"spec/fixtures/api_responses/not_empty_profiles.json\")\n+      )\n+\n+    stub_request(:get, \"#{ api_host }/api/v1/profiles\").\n+      with(query: {access_token: ENV[\"TEST_NAMELY_ACCESS_TOKEN\"], limit: \"all\"}).\n+      to_return(status: 200, body: File.read(\"spec/fixtures/api_responses/empty_profiles.json\"))\n+\n+    post icims_candidate_imports_path, data: import_data\n+\n+    expect(response.body).to be_blank\n+    expect(response.status).to eq 200\n+    expect(sent_email.subject).\n+      to eq(t(\"icims_candidate_import_mailer.successful_import.subject\", name: candidate_name))\n+  end\n+\n+  def stub_person_results\n+    stub_request(:get, \"https://api.icims.com/customers/2187/people/9166\").\n+      with(query: { fields: required_fields }).\n+      to_return(\n+        body: File.read(\"spec/fixtures/api_responses/first_icims_candidate.json\")","path":"spec/requests/icims_statuses_spec.rb","position":44,"original_position":44,"commit_id":"7484ddec0be9c1fcc9e85a0eee862c6a3cc290a8","original_commit_id":"7484ddec0be9c1fcc9e85a0eee862c6a3cc290a8","user":{"login":"hrs","id":278853,"avatar_url":"https://avatars.githubusercontent.com/u/278853?v=3","gravatar_id":"","url":"https://api.github.com/users/hrs","html_url":"https://github.com/hrs","followers_url":"https://api.github.com/users/hrs/followers","following_url":"https://api.github.com/users/hrs/following{/other_user}","gists_url":"https://api.github.com/users/hrs/gists{/gist_id}","starred_url":"https://api.github.com/users/hrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrs/subscriptions","organizations_url":"https://api.github.com/users/hrs/orgs","repos_url":"https://api.github.com/users/hrs/repos","events_url":"https://api.github.com/users/hrs/events{/privacy}","received_events_url":"https://api.github.com/users/hrs/received_events","type":"User","site_admin":false},"body":"Comma","created_at":"2015-04-16T15:28:32Z","updated_at":"2015-04-16T15:28:32Z","html_url":"https://github.com/namely/connect/pull/77#discussion_r28519955","pull_request_url":"https://api.github.com/repos/namely/connect/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/namely/connect/pulls/comments/28519955"},"html":{"href":"https://github.com/namely/connect/pull/77#discussion_r28519955"},"pull_request":{"href":"https://api.github.com/repos/namely/connect/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/namely/connect/pulls/77","id":33396468,"html_url":"https://github.com/namely/connect/pull/77","diff_url":"https://github.com/namely/connect/pull/77.diff","patch_url":"https://github.com/namely/connect/pull/77.patch","issue_url":"https://api.github.com/repos/namely/connect/issues/77","number":77,"state":"open","locked":false,"title":"WIP Import people from iCIMS on webhook","user":{"login":"tabfugnic","id":755201,"avatar_url":"https://avatars.githubusercontent.com/u/755201?v=3","gravatar_id":"","url":"https://api.github.com/users/tabfugnic","html_url":"https://github.com/tabfugnic","followers_url":"https://api.github.com/users/tabfugnic/followers","following_url":"https://api.github.com/users/tabfugnic/following{/other_user}","gists_url":"https://api.github.com/users/tabfugnic/gists{/gist_id}","starred_url":"https://api.github.com/users/tabfugnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tabfugnic/subscriptions","organizations_url":"https://api.github.com/users/tabfugnic/orgs","repos_url":"https://api.github.com/users/tabfugnic/repos","events_url":"https://api.github.com/users/tabfugnic/events{/privacy}","received_events_url":"https://api.github.com/users/tabfugnic/received_events","type":"User","site_admin":false},"body":"* Mail user on successful import\n* Create basic endpoint","created_at":"2015-04-15T21:06:34Z","updated_at":"2015-04-16T15:28:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9108dad379033899bc3f566706d93266c13d390d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/namely/connect/pulls/77/commits","review_comments_url":"https://api.github.com/repos/namely/connect/pulls/77/comments","review_comment_url":"https://api.github.com/repos/namely/connect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/namely/connect/issues/77/comments","statuses_url":"https://api.github.com/repos/namely/connect/statuses/7484ddec0be9c1fcc9e85a0eee862c6a3cc290a8","head":{"label":"namely:webhook-response","ref":"webhook-response","sha":"7484ddec0be9c1fcc9e85a0eee862c6a3cc290a8","user":{"login":"namely","id":1004321,"avatar_url":"https://avatars.githubusercontent.com/u/1004321?v=3","gravatar_id":"","url":"https://api.github.com/users/namely","html_url":"https://github.com/namely","followers_url":"https://api.github.com/users/namely/followers","following_url":"https://api.github.com/users/namely/following{/other_user}","gists_url":"https://api.github.com/users/namely/gists{/gist_id}","starred_url":"https://api.github.com/users/namely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namely/subscriptions","organizations_url":"https://api.github.com/users/namely/orgs","repos_url":"https://api.github.com/users/namely/repos","events_url":"https://api.github.com/users/namely/events{/privacy}","received_events_url":"https://api.github.com/users/namely/received_events","type":"Organization","site_admin":false},"repo":{"id":26101808,"name":"connect","full_name":"namely/connect","owner":{"login":"namely","id":1004321,"avatar_url":"https://avatars.githubusercontent.com/u/1004321?v=3","gravatar_id":"","url":"https://api.github.com/users/namely","html_url":"https://github.com/namely","followers_url":"https://api.github.com/users/namely/followers","following_url":"https://api.github.com/users/namely/following{/other_user}","gists_url":"https://api.github.com/users/namely/gists{/gist_id}","starred_url":"https://api.github.com/users/namely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namely/subscriptions","organizations_url":"https://api.github.com/users/namely/orgs","repos_url":"https://api.github.com/users/namely/repos","events_url":"https://api.github.com/users/namely/events{/privacy}","received_events_url":"https://api.github.com/users/namely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/namely/connect","description":"Namely Connect – Integrate with Namely.","fork":false,"url":"https://api.github.com/repos/namely/connect","forks_url":"https://api.github.com/repos/namely/connect/forks","keys_url":"https://api.github.com/repos/namely/connect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/namely/connect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/namely/connect/teams","hooks_url":"https://api.github.com/repos/namely/connect/hooks","issue_events_url":"https://api.github.com/repos/namely/connect/issues/events{/number}","events_url":"https://api.github.com/repos/namely/connect/events","assignees_url":"https://api.github.com/repos/namely/connect/assignees{/user}","branches_url":"https://api.github.com/repos/namely/connect/branches{/branch}","tags_url":"https://api.github.com/repos/namely/connect/tags","blobs_url":"https://api.github.com/repos/namely/connect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/namely/connect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/namely/connect/git/refs{/sha}","trees_url":"https://api.github.com/repos/namely/connect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/namely/connect/statuses/{sha}","languages_url":"https://api.github.com/repos/namely/connect/languages","stargazers_url":"https://api.github.com/repos/namely/connect/stargazers","contributors_url":"https://api.github.com/repos/namely/connect/contributors","subscribers_url":"https://api.github.com/repos/namely/connect/subscribers","subscription_url":"https://api.github.com/repos/namely/connect/subscription","commits_url":"https://api.github.com/repos/namely/connect/commits{/sha}","git_commits_url":"https://api.github.com/repos/namely/connect/git/commits{/sha}","comments_url":"https://api.github.com/repos/namely/connect/comments{/number}","issue_comment_url":"https://api.github.com/repos/namely/connect/issues/comments{/number}","contents_url":"https://api.github.com/repos/namely/connect/contents/{+path}","compare_url":"https://api.github.com/repos/namely/connect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/namely/connect/merges","archive_url":"https://api.github.com/repos/namely/connect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/namely/connect/downloads","issues_url":"https://api.github.com/repos/namely/connect/issues{/number}","pulls_url":"https://api.github.com/repos/namely/connect/pulls{/number}","milestones_url":"https://api.github.com/repos/namely/connect/milestones{/number}","notifications_url":"https://api.github.com/repos/namely/connect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/namely/connect/labels{/name}","releases_url":"https://api.github.com/repos/namely/connect/releases{/id}","created_at":"2014-11-03T03:10:16Z","updated_at":"2015-04-15T22:33:14Z","pushed_at":"2015-04-16T15:20:17Z","git_url":"git://github.com/namely/connect.git","ssh_url":"git@github.com:namely/connect.git","clone_url":"https://github.com/namely/connect.git","svn_url":"https://github.com/namely/connect","homepage":"","size":3871,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"namely:master","ref":"master","sha":"ff19783ac4d8d1e1545c7343d29077d135a9e66f","user":{"login":"namely","id":1004321,"avatar_url":"https://avatars.githubusercontent.com/u/1004321?v=3","gravatar_id":"","url":"https://api.github.com/users/namely","html_url":"https://github.com/namely","followers_url":"https://api.github.com/users/namely/followers","following_url":"https://api.github.com/users/namely/following{/other_user}","gists_url":"https://api.github.com/users/namely/gists{/gist_id}","starred_url":"https://api.github.com/users/namely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namely/subscriptions","organizations_url":"https://api.github.com/users/namely/orgs","repos_url":"https://api.github.com/users/namely/repos","events_url":"https://api.github.com/users/namely/events{/privacy}","received_events_url":"https://api.github.com/users/namely/received_events","type":"Organization","site_admin":false},"repo":{"id":26101808,"name":"connect","full_name":"namely/connect","owner":{"login":"namely","id":1004321,"avatar_url":"https://avatars.githubusercontent.com/u/1004321?v=3","gravatar_id":"","url":"https://api.github.com/users/namely","html_url":"https://github.com/namely","followers_url":"https://api.github.com/users/namely/followers","following_url":"https://api.github.com/users/namely/following{/other_user}","gists_url":"https://api.github.com/users/namely/gists{/gist_id}","starred_url":"https://api.github.com/users/namely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namely/subscriptions","organizations_url":"https://api.github.com/users/namely/orgs","repos_url":"https://api.github.com/users/namely/repos","events_url":"https://api.github.com/users/namely/events{/privacy}","received_events_url":"https://api.github.com/users/namely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/namely/connect","description":"Namely Connect – Integrate with Namely.","fork":false,"url":"https://api.github.com/repos/namely/connect","forks_url":"https://api.github.com/repos/namely/connect/forks","keys_url":"https://api.github.com/repos/namely/connect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/namely/connect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/namely/connect/teams","hooks_url":"https://api.github.com/repos/namely/connect/hooks","issue_events_url":"https://api.github.com/repos/namely/connect/issues/events{/number}","events_url":"https://api.github.com/repos/namely/connect/events","assignees_url":"https://api.github.com/repos/namely/connect/assignees{/user}","branches_url":"https://api.github.com/repos/namely/connect/branches{/branch}","tags_url":"https://api.github.com/repos/namely/connect/tags","blobs_url":"https://api.github.com/repos/namely/connect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/namely/connect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/namely/connect/git/refs{/sha}","trees_url":"https://api.github.com/repos/namely/connect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/namely/connect/statuses/{sha}","languages_url":"https://api.github.com/repos/namely/connect/languages","stargazers_url":"https://api.github.com/repos/namely/connect/stargazers","contributors_url":"https://api.github.com/repos/namely/connect/contributors","subscribers_url":"https://api.github.com/repos/namely/connect/subscribers","subscription_url":"https://api.github.com/repos/namely/connect/subscription","commits_url":"https://api.github.com/repos/namely/connect/commits{/sha}","git_commits_url":"https://api.github.com/repos/namely/connect/git/commits{/sha}","comments_url":"https://api.github.com/repos/namely/connect/comments{/number}","issue_comment_url":"https://api.github.com/repos/namely/connect/issues/comments{/number}","contents_url":"https://api.github.com/repos/namely/connect/contents/{+path}","compare_url":"https://api.github.com/repos/namely/connect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/namely/connect/merges","archive_url":"https://api.github.com/repos/namely/connect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/namely/connect/downloads","issues_url":"https://api.github.com/repos/namely/connect/issues{/number}","pulls_url":"https://api.github.com/repos/namely/connect/pulls{/number}","milestones_url":"https://api.github.com/repos/namely/connect/milestones{/number}","notifications_url":"https://api.github.com/repos/namely/connect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/namely/connect/labels{/name}","releases_url":"https://api.github.com/repos/namely/connect/releases{/id}","created_at":"2014-11-03T03:10:16Z","updated_at":"2015-04-15T22:33:14Z","pushed_at":"2015-04-16T15:20:17Z","git_url":"git://github.com/namely/connect.git","ssh_url":"git@github.com:namely/connect.git","clone_url":"https://github.com/namely/connect.git","svn_url":"https://github.com/namely/connect","homepage":"","size":3871,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/namely/connect/pulls/77"},"html":{"href":"https://github.com/namely/connect/pull/77"},"issue":{"href":"https://api.github.com/repos/namely/connect/issues/77"},"comments":{"href":"https://api.github.com/repos/namely/connect/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/namely/connect/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/namely/connect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/namely/connect/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/namely/connect/statuses/7484ddec0be9c1fcc9e85a0eee862c6a3cc290a8"}}}}