{"action":"created","comment":{"url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/comments/44541951","id":44541951,"diff_hunk":"@@ -1,4 +1,257 @@\n require \"spec_helper\"\n \n RSpec.describe SecondContactsController, type: :controller do\n+  def sign_in_admin\n+    sign_in_user instance_double(User,\n+                                 nurse?: false,\n+                                 locale: %w( en pt-BR es-PE ).sample,\n+                                 timezone: \"America/Chicago\")\n+  end\n+\n+  let(:valid_second_contact_params) do\n+    { contact_at: Time.new, session_length: 1, next_contact: Time.new }\n+  end\n+\n+  let(:invalid_second_contact_params) do\n+    { contact_at: nil, session_length: nil, next_contact: nil }\n+  end\n+\n+  let(:participant) { Participant.first }\n+\n+  shared_examples \"a bad request\" do\n+    it \"should redirect to the active_participants_url\" do\n+      expect(response).to redirect_to active_participants_url\n+    end\n+  end\n+\n+  describe \"GET new\" do\n+    context \"for an unauthenticated User\" do\n+      before { get :new, participant_id: participant.id }\n+\n+      it_behaves_like \"a rejected user action\"\n+    end\n+\n+    context \"for an authenticated User\" do\n+      context \"when the Participant isn't found\" do\n+        before do\n+          sign_in_admin\n+\n+          get :new, participant_id: -1\n+        end\n+\n+        it_behaves_like \"a bad request\"\n+      end\n+\n+      it \"sets the second_contact\" do","path":"spec/controllers/second_contacts_controller_spec.rb","position":45,"original_position":45,"commit_id":"2e512963a54f0aed4facc442dee1858c584a9a69","original_commit_id":"2e512963a54f0aed4facc442dee1858c584a9a69","user":{"login":"ericcf","id":58693,"avatar_url":"https://avatars.githubusercontent.com/u/58693?v=3","gravatar_id":"","url":"https://api.github.com/users/ericcf","html_url":"https://github.com/ericcf","followers_url":"https://api.github.com/users/ericcf/followers","following_url":"https://api.github.com/users/ericcf/following{/other_user}","gists_url":"https://api.github.com/users/ericcf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericcf/subscriptions","organizations_url":"https://api.github.com/users/ericcf/orgs","repos_url":"https://api.github.com/users/ericcf/repos","events_url":"https://api.github.com/users/ericcf/events{/privacy}","received_events_url":"https://api.github.com/users/ericcf/received_events","type":"User","site_admin":false},"body":"Fair point - although to be accurate it's not a method name, it's a symbol. Would something like just `it \"sets the second contact\"` be better?","created_at":"2015-11-11T15:10:20Z","updated_at":"2015-11-11T15:10:20Z","html_url":"https://github.com/cbitstech/conemo_dashboard/pull/27#discussion_r44541951","pull_request_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/comments/44541951"},"html":{"href":"https://github.com/cbitstech/conemo_dashboard/pull/27#discussion_r44541951"},"pull_request":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27","id":50313931,"html_url":"https://github.com/cbitstech/conemo_dashboard/pull/27","diff_url":"https://github.com/cbitstech/conemo_dashboard/pull/27.diff","patch_url":"https://github.com/cbitstech/conemo_dashboard/pull/27.patch","issue_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/27","number":27,"state":"open","locked":false,"title":"update DialoguesController and SecondContactsController specs","user":{"login":"ericcf","id":58693,"avatar_url":"https://avatars.githubusercontent.com/u/58693?v=3","gravatar_id":"","url":"https://api.github.com/users/ericcf","html_url":"https://github.com/ericcf","followers_url":"https://api.github.com/users/ericcf/followers","following_url":"https://api.github.com/users/ericcf/following{/other_user}","gists_url":"https://api.github.com/users/ericcf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericcf/subscriptions","organizations_url":"https://api.github.com/users/ericcf/orgs","repos_url":"https://api.github.com/users/ericcf/repos","events_url":"https://api.github.com/users/ericcf/events{/privacy}","received_events_url":"https://api.github.com/users/ericcf/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-11-10T21:30:38Z","updated_at":"2015-11-11T15:10:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a9c497cf27b11529ff9c81c33fb90beb3016327","assignee":{"login":"michaelwehrley","id":526136,"avatar_url":"https://avatars.githubusercontent.com/u/526136?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwehrley","html_url":"https://github.com/michaelwehrley","followers_url":"https://api.github.com/users/michaelwehrley/followers","following_url":"https://api.github.com/users/michaelwehrley/following{/other_user}","gists_url":"https://api.github.com/users/michaelwehrley/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwehrley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwehrley/subscriptions","organizations_url":"https://api.github.com/users/michaelwehrley/orgs","repos_url":"https://api.github.com/users/michaelwehrley/repos","events_url":"https://api.github.com/users/michaelwehrley/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwehrley/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27/commits","review_comments_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27/comments","review_comment_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/27/comments","statuses_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/statuses/2e512963a54f0aed4facc442dee1858c584a9a69","head":{"label":"cbitstech:ecf_second_contacts_controller_specs","ref":"ecf_second_contacts_controller_specs","sha":"2e512963a54f0aed4facc442dee1858c584a9a69","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":18811970,"name":"conemo_dashboard","full_name":"cbitstech/conemo_dashboard","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/conemo_dashboard","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/conemo_dashboard","forks_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/forks","keys_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/teams","hooks_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/events","assignees_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/tags","blobs_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/languages","stargazers_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/subscription","commits_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/merges","archive_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/downloads","issues_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/releases{/id}","created_at":"2014-04-15T18:56:42Z","updated_at":"2015-04-28T02:00:02Z","pushed_at":"2015-11-11T00:51:11Z","git_url":"git://github.com/cbitstech/conemo_dashboard.git","ssh_url":"git@github.com:cbitstech/conemo_dashboard.git","clone_url":"https://github.com/cbitstech/conemo_dashboard.git","svn_url":"https://github.com/cbitstech/conemo_dashboard","homepage":null,"size":3592,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"cbitstech:master","ref":"master","sha":"15521069b3f315acd1235841c8863ae591e8d4f3","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":18811970,"name":"conemo_dashboard","full_name":"cbitstech/conemo_dashboard","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/conemo_dashboard","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/conemo_dashboard","forks_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/forks","keys_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/teams","hooks_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/events","assignees_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/tags","blobs_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/languages","stargazers_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/subscription","commits_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/merges","archive_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/downloads","issues_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/conemo_dashboard/releases{/id}","created_at":"2014-04-15T18:56:42Z","updated_at":"2015-04-28T02:00:02Z","pushed_at":"2015-11-11T00:51:11Z","git_url":"git://github.com/cbitstech/conemo_dashboard.git","ssh_url":"git@github.com:cbitstech/conemo_dashboard.git","clone_url":"https://github.com/cbitstech/conemo_dashboard.git","svn_url":"https://github.com/cbitstech/conemo_dashboard","homepage":null,"size":3592,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27"},"html":{"href":"https://github.com/cbitstech/conemo_dashboard/pull/27"},"issue":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/27"},"comments":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/cbitstech/conemo_dashboard/statuses/2e512963a54f0aed4facc442dee1858c584a9a69"}}}}