{"action":"created","comment":{"url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/comments/57162664","id":57162664,"diff_hunk":"@@ -0,0 +1,9 @@\n+module ControllerMacros\n+  def login_user\n+    before(:each) do","path":"spec/support/controller_macros.rb","position":3,"original_position":3,"commit_id":"b641f80c2f99a73b01c5f5637a3b41e89d7ae50e","original_commit_id":"b641f80c2f99a73b01c5f5637a3b41e89d7ae50e","user":{"login":"ms2sato","id":627817,"avatar_url":"https://avatars.githubusercontent.com/u/627817?v=3","gravatar_id":"","url":"https://api.github.com/users/ms2sato","html_url":"https://github.com/ms2sato","followers_url":"https://api.github.com/users/ms2sato/followers","following_url":"https://api.github.com/users/ms2sato/following{/other_user}","gists_url":"https://api.github.com/users/ms2sato/gists{/gist_id}","starred_url":"https://api.github.com/users/ms2sato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms2sato/subscriptions","organizations_url":"https://api.github.com/users/ms2sato/orgs","repos_url":"https://api.github.com/users/ms2sato/repos","events_url":"https://api.github.com/users/ms2sato/events{/privacy}","received_events_url":"https://api.github.com/users/ms2sato/received_events","type":"User","site_admin":false},"body":"関数の中なので、before 入っているとエラーですよね。","created_at":"2016-03-23T13:58:56Z","updated_at":"2016-03-23T13:58:56Z","html_url":"https://github.com/shuheiktgw/todo_list/pull/30#discussion_r57162664","pull_request_url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/comments/57162664"},"html":{"href":"https://github.com/shuheiktgw/todo_list/pull/30#discussion_r57162664"},"pull_request":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30","id":63821981,"html_url":"https://github.com/shuheiktgw/todo_list/pull/30","diff_url":"https://github.com/shuheiktgw/todo_list/pull/30.diff","patch_url":"https://github.com/shuheiktgw/todo_list/pull/30.patch","issue_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues/30","number":30,"state":"open","locked":false,"title":"[WIP ]「コントローラのテスト」を調査して、実装してみる","user":{"login":"shuheiktgw","id":7028383,"avatar_url":"https://avatars.githubusercontent.com/u/7028383?v=3","gravatar_id":"","url":"https://api.github.com/users/shuheiktgw","html_url":"https://github.com/shuheiktgw","followers_url":"https://api.github.com/users/shuheiktgw/followers","following_url":"https://api.github.com/users/shuheiktgw/following{/other_user}","gists_url":"https://api.github.com/users/shuheiktgw/gists{/gist_id}","starred_url":"https://api.github.com/users/shuheiktgw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuheiktgw/subscriptions","organizations_url":"https://api.github.com/users/shuheiktgw/orgs","repos_url":"https://api.github.com/users/shuheiktgw/repos","events_url":"https://api.github.com/users/shuheiktgw/events{/privacy}","received_events_url":"https://api.github.com/users/shuheiktgw/received_events","type":"User","site_admin":false},"body":"手始めにtasksのコントローラーテストを書いて見たのですが,controllerの持っているcurrent_userがnilのため #set_taskがうまくテストから動かせません. 調べたのですが.よくわからず...これはどうすればいいでしょうか?\r\n\r\n@ms2sato","created_at":"2016-03-23T02:13:12Z","updated_at":"2016-03-23T13:58:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4516a4b69a9f49445eaa1eef757b18cfbf112d62","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30/commits","review_comments_url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30/comments","review_comment_url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues/30/comments","statuses_url":"https://api.github.com/repos/shuheiktgw/todo_list/statuses/b641f80c2f99a73b01c5f5637a3b41e89d7ae50e","head":{"label":"shuheiktgw:add_controllers_tests","ref":"add_controllers_tests","sha":"b641f80c2f99a73b01c5f5637a3b41e89d7ae50e","user":{"login":"shuheiktgw","id":7028383,"avatar_url":"https://avatars.githubusercontent.com/u/7028383?v=3","gravatar_id":"","url":"https://api.github.com/users/shuheiktgw","html_url":"https://github.com/shuheiktgw","followers_url":"https://api.github.com/users/shuheiktgw/followers","following_url":"https://api.github.com/users/shuheiktgw/following{/other_user}","gists_url":"https://api.github.com/users/shuheiktgw/gists{/gist_id}","starred_url":"https://api.github.com/users/shuheiktgw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuheiktgw/subscriptions","organizations_url":"https://api.github.com/users/shuheiktgw/orgs","repos_url":"https://api.github.com/users/shuheiktgw/repos","events_url":"https://api.github.com/users/shuheiktgw/events{/privacy}","received_events_url":"https://api.github.com/users/shuheiktgw/received_events","type":"User","site_admin":false},"repo":{"id":53385646,"name":"todo_list","full_name":"shuheiktgw/todo_list","owner":{"login":"shuheiktgw","id":7028383,"avatar_url":"https://avatars.githubusercontent.com/u/7028383?v=3","gravatar_id":"","url":"https://api.github.com/users/shuheiktgw","html_url":"https://github.com/shuheiktgw","followers_url":"https://api.github.com/users/shuheiktgw/followers","following_url":"https://api.github.com/users/shuheiktgw/following{/other_user}","gists_url":"https://api.github.com/users/shuheiktgw/gists{/gist_id}","starred_url":"https://api.github.com/users/shuheiktgw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuheiktgw/subscriptions","organizations_url":"https://api.github.com/users/shuheiktgw/orgs","repos_url":"https://api.github.com/users/shuheiktgw/repos","events_url":"https://api.github.com/users/shuheiktgw/events{/privacy}","received_events_url":"https://api.github.com/users/shuheiktgw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shuheiktgw/todo_list","description":"","fork":false,"url":"https://api.github.com/repos/shuheiktgw/todo_list","forks_url":"https://api.github.com/repos/shuheiktgw/todo_list/forks","keys_url":"https://api.github.com/repos/shuheiktgw/todo_list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shuheiktgw/todo_list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shuheiktgw/todo_list/teams","hooks_url":"https://api.github.com/repos/shuheiktgw/todo_list/hooks","issue_events_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues/events{/number}","events_url":"https://api.github.com/repos/shuheiktgw/todo_list/events","assignees_url":"https://api.github.com/repos/shuheiktgw/todo_list/assignees{/user}","branches_url":"https://api.github.com/repos/shuheiktgw/todo_list/branches{/branch}","tags_url":"https://api.github.com/repos/shuheiktgw/todo_list/tags","blobs_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/refs{/sha}","trees_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shuheiktgw/todo_list/statuses/{sha}","languages_url":"https://api.github.com/repos/shuheiktgw/todo_list/languages","stargazers_url":"https://api.github.com/repos/shuheiktgw/todo_list/stargazers","contributors_url":"https://api.github.com/repos/shuheiktgw/todo_list/contributors","subscribers_url":"https://api.github.com/repos/shuheiktgw/todo_list/subscribers","subscription_url":"https://api.github.com/repos/shuheiktgw/todo_list/subscription","commits_url":"https://api.github.com/repos/shuheiktgw/todo_list/commits{/sha}","git_commits_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/commits{/sha}","comments_url":"https://api.github.com/repos/shuheiktgw/todo_list/comments{/number}","issue_comment_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues/comments{/number}","contents_url":"https://api.github.com/repos/shuheiktgw/todo_list/contents/{+path}","compare_url":"https://api.github.com/repos/shuheiktgw/todo_list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shuheiktgw/todo_list/merges","archive_url":"https://api.github.com/repos/shuheiktgw/todo_list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shuheiktgw/todo_list/downloads","issues_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues{/number}","pulls_url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls{/number}","milestones_url":"https://api.github.com/repos/shuheiktgw/todo_list/milestones{/number}","notifications_url":"https://api.github.com/repos/shuheiktgw/todo_list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shuheiktgw/todo_list/labels{/name}","releases_url":"https://api.github.com/repos/shuheiktgw/todo_list/releases{/id}","deployments_url":"https://api.github.com/repos/shuheiktgw/todo_list/deployments","created_at":"2016-03-08T05:37:08Z","updated_at":"2016-03-08T05:41:22Z","pushed_at":"2016-03-23T11:25:53Z","git_url":"git://github.com/shuheiktgw/todo_list.git","ssh_url":"git@github.com:shuheiktgw/todo_list.git","clone_url":"https://github.com/shuheiktgw/todo_list.git","svn_url":"https://github.com/shuheiktgw/todo_list","homepage":null,"size":135,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"shuheiktgw:master","ref":"master","sha":"561f798df74c3495fbd0ec5aa74b14a576429034","user":{"login":"shuheiktgw","id":7028383,"avatar_url":"https://avatars.githubusercontent.com/u/7028383?v=3","gravatar_id":"","url":"https://api.github.com/users/shuheiktgw","html_url":"https://github.com/shuheiktgw","followers_url":"https://api.github.com/users/shuheiktgw/followers","following_url":"https://api.github.com/users/shuheiktgw/following{/other_user}","gists_url":"https://api.github.com/users/shuheiktgw/gists{/gist_id}","starred_url":"https://api.github.com/users/shuheiktgw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuheiktgw/subscriptions","organizations_url":"https://api.github.com/users/shuheiktgw/orgs","repos_url":"https://api.github.com/users/shuheiktgw/repos","events_url":"https://api.github.com/users/shuheiktgw/events{/privacy}","received_events_url":"https://api.github.com/users/shuheiktgw/received_events","type":"User","site_admin":false},"repo":{"id":53385646,"name":"todo_list","full_name":"shuheiktgw/todo_list","owner":{"login":"shuheiktgw","id":7028383,"avatar_url":"https://avatars.githubusercontent.com/u/7028383?v=3","gravatar_id":"","url":"https://api.github.com/users/shuheiktgw","html_url":"https://github.com/shuheiktgw","followers_url":"https://api.github.com/users/shuheiktgw/followers","following_url":"https://api.github.com/users/shuheiktgw/following{/other_user}","gists_url":"https://api.github.com/users/shuheiktgw/gists{/gist_id}","starred_url":"https://api.github.com/users/shuheiktgw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuheiktgw/subscriptions","organizations_url":"https://api.github.com/users/shuheiktgw/orgs","repos_url":"https://api.github.com/users/shuheiktgw/repos","events_url":"https://api.github.com/users/shuheiktgw/events{/privacy}","received_events_url":"https://api.github.com/users/shuheiktgw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shuheiktgw/todo_list","description":"","fork":false,"url":"https://api.github.com/repos/shuheiktgw/todo_list","forks_url":"https://api.github.com/repos/shuheiktgw/todo_list/forks","keys_url":"https://api.github.com/repos/shuheiktgw/todo_list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shuheiktgw/todo_list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shuheiktgw/todo_list/teams","hooks_url":"https://api.github.com/repos/shuheiktgw/todo_list/hooks","issue_events_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues/events{/number}","events_url":"https://api.github.com/repos/shuheiktgw/todo_list/events","assignees_url":"https://api.github.com/repos/shuheiktgw/todo_list/assignees{/user}","branches_url":"https://api.github.com/repos/shuheiktgw/todo_list/branches{/branch}","tags_url":"https://api.github.com/repos/shuheiktgw/todo_list/tags","blobs_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/refs{/sha}","trees_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shuheiktgw/todo_list/statuses/{sha}","languages_url":"https://api.github.com/repos/shuheiktgw/todo_list/languages","stargazers_url":"https://api.github.com/repos/shuheiktgw/todo_list/stargazers","contributors_url":"https://api.github.com/repos/shuheiktgw/todo_list/contributors","subscribers_url":"https://api.github.com/repos/shuheiktgw/todo_list/subscribers","subscription_url":"https://api.github.com/repos/shuheiktgw/todo_list/subscription","commits_url":"https://api.github.com/repos/shuheiktgw/todo_list/commits{/sha}","git_commits_url":"https://api.github.com/repos/shuheiktgw/todo_list/git/commits{/sha}","comments_url":"https://api.github.com/repos/shuheiktgw/todo_list/comments{/number}","issue_comment_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues/comments{/number}","contents_url":"https://api.github.com/repos/shuheiktgw/todo_list/contents/{+path}","compare_url":"https://api.github.com/repos/shuheiktgw/todo_list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shuheiktgw/todo_list/merges","archive_url":"https://api.github.com/repos/shuheiktgw/todo_list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shuheiktgw/todo_list/downloads","issues_url":"https://api.github.com/repos/shuheiktgw/todo_list/issues{/number}","pulls_url":"https://api.github.com/repos/shuheiktgw/todo_list/pulls{/number}","milestones_url":"https://api.github.com/repos/shuheiktgw/todo_list/milestones{/number}","notifications_url":"https://api.github.com/repos/shuheiktgw/todo_list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shuheiktgw/todo_list/labels{/name}","releases_url":"https://api.github.com/repos/shuheiktgw/todo_list/releases{/id}","deployments_url":"https://api.github.com/repos/shuheiktgw/todo_list/deployments","created_at":"2016-03-08T05:37:08Z","updated_at":"2016-03-08T05:41:22Z","pushed_at":"2016-03-23T11:25:53Z","git_url":"git://github.com/shuheiktgw/todo_list.git","ssh_url":"git@github.com:shuheiktgw/todo_list.git","clone_url":"https://github.com/shuheiktgw/todo_list.git","svn_url":"https://github.com/shuheiktgw/todo_list","homepage":null,"size":135,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30"},"html":{"href":"https://github.com/shuheiktgw/todo_list/pull/30"},"issue":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/issues/30"},"comments":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/shuheiktgw/todo_list/statuses/b641f80c2f99a73b01c5f5637a3b41e89d7ae50e"}}}}