{"action":"created","comment":{"url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/comments/53120581","id":53120581,"diff_hunk":"@@ -0,0 +1,51 @@\n+require 'test_helper'\n+\n+class CallsControllerTest < ActionController::TestCase\n+  include Devise::TestHelpers\n+\n+  def setup\n+    @user = build :user\n+    sign_in @user\n+    @case = create :case\n+    @call = build :call\n+  end\n+\n+  describe 'create method' do\n+    before do\n+      @call = attributes_for :call\n+    end\n+\n+    it 'should create and save a new call' do\n+      assert_difference 'Case.find(@case).calls.count', 1 do\n+        post :create, status: @call.status, id: @case\n+      end\n+      assert_response :redirect\n+    end\n+\n+    # If we have to look up the call through a case this test seems redundant\n+    # I.e. I think the previous test also confirms the association\n+    # it 'should associate the new call with a case' do\n+    #   post :create, status: @call.status, id: @case\n+    #   assert_equal Case.find(@case).calls.last.case, @case\n+    #   assert_includes Case.find(@case).calls, Case.find(@case).calls.last\n+    # end\n+\n+    it 'should redirect to the root path afterwards' do\n+      post :create, status: @call.status, id: @case\n+      assert_redirected_to root_path\n+    end\n+\n+    it 'should not save if status is blank for some reason' do\n+      assert_difference 'Case.find(@case).calls.count', 0 do\n+        post :create, status: nil, id: @case\n+      end\n+    end\n+\n+    it 'should reject other attributes besides status' do\n+      post :create, status: @call.status, other: \"extraneous attribute\", id: @case","path":"test/controllers/calls_controller_test.rb","position":45,"original_position":45,"commit_id":"8410635e137fca4ffe6063618c41eba98c054322","original_commit_id":"8410635e137fca4ffe6063618c41eba98c054322","user":{"login":"colinxfleming","id":3866868,"avatar_url":"https://avatars.githubusercontent.com/u/3866868?v=3","gravatar_id":"","url":"https://api.github.com/users/colinxfleming","html_url":"https://github.com/colinxfleming","followers_url":"https://api.github.com/users/colinxfleming/followers","following_url":"https://api.github.com/users/colinxfleming/following{/other_user}","gists_url":"https://api.github.com/users/colinxfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/colinxfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinxfleming/subscriptions","organizations_url":"https://api.github.com/users/colinxfleming/orgs","repos_url":"https://api.github.com/users/colinxfleming/repos","events_url":"https://api.github.com/users/colinxfleming/events{/privacy}","received_events_url":"https://api.github.com/users/colinxfleming/received_events","type":"User","site_admin":false},"body":"(You might have to add strong params to get this to work! Check out @drownedout 's `patient_params` in the patients controller for an example, and LMK if you have any trouble getting it to behave.)","created_at":"2016-02-17T04:45:43Z","updated_at":"2016-02-17T04:45:43Z","html_url":"https://github.com/colinxfleming/dcaf_case_management/pull/83#discussion_r53120581","pull_request_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/comments/53120581"},"html":{"href":"https://github.com/colinxfleming/dcaf_case_management/pull/83#discussion_r53120581"},"pull_request":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83","id":59507735,"html_url":"https://github.com/colinxfleming/dcaf_case_management/pull/83","diff_url":"https://github.com/colinxfleming/dcaf_case_management/pull/83.diff","patch_url":"https://github.com/colinxfleming/dcaf_case_management/pull/83.patch","issue_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues/83","number":83,"state":"open","locked":false,"title":"Minitest","user":{"login":"ajohnson052","id":14868930,"avatar_url":"https://avatars.githubusercontent.com/u/14868930?v=3","gravatar_id":"","url":"https://api.github.com/users/ajohnson052","html_url":"https://github.com/ajohnson052","followers_url":"https://api.github.com/users/ajohnson052/followers","following_url":"https://api.github.com/users/ajohnson052/following{/other_user}","gists_url":"https://api.github.com/users/ajohnson052/gists{/gist_id}","starred_url":"https://api.github.com/users/ajohnson052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajohnson052/subscriptions","organizations_url":"https://api.github.com/users/ajohnson052/orgs","repos_url":"https://api.github.com/users/ajohnson052/repos","events_url":"https://api.github.com/users/ajohnson052/events{/privacy}","received_events_url":"https://api.github.com/users/ajohnson052/received_events","type":"User","site_admin":false},"body":"Hey Colin, thanks again for the help yesterday! A few things came up as I was going through the rest of the call controller. It looks like we had been saving calls without statuses in our first test. Now I am validating by status in the call model so the test needed updated. There’s also one test that doesn’t make much sense the way I’m approaching it, but I’ve included inline comments to explain the problem. Feel free to come back with lots of comments! This isn't quite ready to merge, but I'm just assuming that a PR is still the easiest way to give/get feedback.","created_at":"2016-02-16T15:36:56Z","updated_at":"2016-02-17T04:45:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ea41efabda466202251ddf1ffd64c652266e594","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83/commits","review_comments_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83/comments","review_comment_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/comments{/number}","comments_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues/83/comments","statuses_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/statuses/8410635e137fca4ffe6063618c41eba98c054322","head":{"label":"ajohnson052:minitest","ref":"minitest","sha":"8410635e137fca4ffe6063618c41eba98c054322","user":{"login":"ajohnson052","id":14868930,"avatar_url":"https://avatars.githubusercontent.com/u/14868930?v=3","gravatar_id":"","url":"https://api.github.com/users/ajohnson052","html_url":"https://github.com/ajohnson052","followers_url":"https://api.github.com/users/ajohnson052/followers","following_url":"https://api.github.com/users/ajohnson052/following{/other_user}","gists_url":"https://api.github.com/users/ajohnson052/gists{/gist_id}","starred_url":"https://api.github.com/users/ajohnson052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajohnson052/subscriptions","organizations_url":"https://api.github.com/users/ajohnson052/orgs","repos_url":"https://api.github.com/users/ajohnson052/repos","events_url":"https://api.github.com/users/ajohnson052/events{/privacy}","received_events_url":"https://api.github.com/users/ajohnson052/received_events","type":"User","site_admin":false},"repo":{"id":51338423,"name":"dcaf_case_management","full_name":"ajohnson052/dcaf_case_management","owner":{"login":"ajohnson052","id":14868930,"avatar_url":"https://avatars.githubusercontent.com/u/14868930?v=3","gravatar_id":"","url":"https://api.github.com/users/ajohnson052","html_url":"https://github.com/ajohnson052","followers_url":"https://api.github.com/users/ajohnson052/followers","following_url":"https://api.github.com/users/ajohnson052/following{/other_user}","gists_url":"https://api.github.com/users/ajohnson052/gists{/gist_id}","starred_url":"https://api.github.com/users/ajohnson052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajohnson052/subscriptions","organizations_url":"https://api.github.com/users/ajohnson052/orgs","repos_url":"https://api.github.com/users/ajohnson052/repos","events_url":"https://api.github.com/users/ajohnson052/events{/privacy}","received_events_url":"https://api.github.com/users/ajohnson052/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ajohnson052/dcaf_case_management","description":"Rails-based case management system for the DC Abortion Fund","fork":true,"url":"https://api.github.com/repos/ajohnson052/dcaf_case_management","forks_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/forks","keys_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/teams","hooks_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/hooks","issue_events_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/issues/events{/number}","events_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/events","assignees_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/assignees{/user}","branches_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/branches{/branch}","tags_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/tags","blobs_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/statuses/{sha}","languages_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/languages","stargazers_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/stargazers","contributors_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/contributors","subscribers_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/subscribers","subscription_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/subscription","commits_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/contents/{+path}","compare_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/merges","archive_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/downloads","issues_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/issues{/number}","pulls_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/pulls{/number}","milestones_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/milestones{/number}","notifications_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/labels{/name}","releases_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/releases{/id}","deployments_url":"https://api.github.com/repos/ajohnson052/dcaf_case_management/deployments","created_at":"2016-02-09T00:50:35Z","updated_at":"2016-02-09T00:50:36Z","pushed_at":"2016-02-16T15:30:30Z","git_url":"git://github.com/ajohnson052/dcaf_case_management.git","ssh_url":"git@github.com:ajohnson052/dcaf_case_management.git","clone_url":"https://github.com/ajohnson052/dcaf_case_management.git","svn_url":"https://github.com/ajohnson052/dcaf_case_management","homepage":"","size":6566,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"colinxfleming:master","ref":"master","sha":"6c133718810c83620dc2374e42a3cf9dd71325cf","user":{"login":"colinxfleming","id":3866868,"avatar_url":"https://avatars.githubusercontent.com/u/3866868?v=3","gravatar_id":"","url":"https://api.github.com/users/colinxfleming","html_url":"https://github.com/colinxfleming","followers_url":"https://api.github.com/users/colinxfleming/followers","following_url":"https://api.github.com/users/colinxfleming/following{/other_user}","gists_url":"https://api.github.com/users/colinxfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/colinxfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinxfleming/subscriptions","organizations_url":"https://api.github.com/users/colinxfleming/orgs","repos_url":"https://api.github.com/users/colinxfleming/repos","events_url":"https://api.github.com/users/colinxfleming/events{/privacy}","received_events_url":"https://api.github.com/users/colinxfleming/received_events","type":"User","site_admin":false},"repo":{"id":43036761,"name":"dcaf_case_management","full_name":"colinxfleming/dcaf_case_management","owner":{"login":"colinxfleming","id":3866868,"avatar_url":"https://avatars.githubusercontent.com/u/3866868?v=3","gravatar_id":"","url":"https://api.github.com/users/colinxfleming","html_url":"https://github.com/colinxfleming","followers_url":"https://api.github.com/users/colinxfleming/followers","following_url":"https://api.github.com/users/colinxfleming/following{/other_user}","gists_url":"https://api.github.com/users/colinxfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/colinxfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinxfleming/subscriptions","organizations_url":"https://api.github.com/users/colinxfleming/orgs","repos_url":"https://api.github.com/users/colinxfleming/repos","events_url":"https://api.github.com/users/colinxfleming/events{/privacy}","received_events_url":"https://api.github.com/users/colinxfleming/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/colinxfleming/dcaf_case_management","description":"Rails-based case management system for the DC Abortion Fund","fork":false,"url":"https://api.github.com/repos/colinxfleming/dcaf_case_management","forks_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/forks","keys_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/teams","hooks_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/hooks","issue_events_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues/events{/number}","events_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/events","assignees_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/assignees{/user}","branches_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/branches{/branch}","tags_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/tags","blobs_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/git/refs{/sha}","trees_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/statuses/{sha}","languages_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/languages","stargazers_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/stargazers","contributors_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/contributors","subscribers_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/subscribers","subscription_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/subscription","commits_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/commits{/sha}","git_commits_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/git/commits{/sha}","comments_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/comments{/number}","issue_comment_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues/comments{/number}","contents_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/contents/{+path}","compare_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/merges","archive_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/downloads","issues_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues{/number}","pulls_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls{/number}","milestones_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/milestones{/number}","notifications_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/labels{/name}","releases_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/releases{/id}","deployments_url":"https://api.github.com/repos/colinxfleming/dcaf_case_management/deployments","created_at":"2015-09-24T01:19:39Z","updated_at":"2016-01-12T04:21:15Z","pushed_at":"2016-02-16T15:36:56Z","git_url":"git://github.com/colinxfleming/dcaf_case_management.git","ssh_url":"git@github.com:colinxfleming/dcaf_case_management.git","clone_url":"https://github.com/colinxfleming/dcaf_case_management.git","svn_url":"https://github.com/colinxfleming/dcaf_case_management","homepage":"","size":6571,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":26,"forks":14,"open_issues":26,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83"},"html":{"href":"https://github.com/colinxfleming/dcaf_case_management/pull/83"},"issue":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues/83"},"comments":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/colinxfleming/dcaf_case_management/statuses/8410635e137fca4ffe6063618c41eba98c054322"}}}}