{"action":"created","comment":{"url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/comments/68510291","id":68510291,"diff_hunk":"@@ -0,0 +1,36 @@\n+module RequestsSupport\n+  shared_examples_for 'HTTP 200 OK' do\n+    it '200 OK で応答すること' do\n+      subject\n+      expect(response).to have_http_status 200\n+    end\n+  end\n+\n+  shared_examples_for 'HTTP 302 OK' do\n+    it '302 OK で応答すること' do\n+      subject\n+      expect(response).to have_http_status 302","path":"spec/support/requests_support.rb","position":12,"original_position":12,"commit_id":"e033838ca532ec4580a29b1153c34075c299edd8","original_commit_id":"e033838ca532ec4580a29b1153c34075c299edd8","user":{"login":"a-know","id":1097533,"avatar_url":"https://avatars.githubusercontent.com/u/1097533?v=3","gravatar_id":"","url":"https://api.github.com/users/a-know","html_url":"https://github.com/a-know","followers_url":"https://api.github.com/users/a-know/followers","following_url":"https://api.github.com/users/a-know/following{/other_user}","gists_url":"https://api.github.com/users/a-know/gists{/gist_id}","starred_url":"https://api.github.com/users/a-know/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-know/subscriptions","organizations_url":"https://api.github.com/users/a-know/orgs","repos_url":"https://api.github.com/users/a-know/repos","events_url":"https://api.github.com/users/a-know/events{/privacy}","received_events_url":"https://api.github.com/users/a-know/received_events","type":"User","site_admin":false},"body":"`302` とかを let で外部から渡す方式もあるかなーとか思ったけど、\r\n僕もこっちのが好みかなーとも思った、少なくとも今のところは（感想）","created_at":"2016-06-26T21:40:37Z","updated_at":"2016-06-26T21:40:37Z","html_url":"https://github.com/pokotyamu/awesome_events/pull/20#discussion_r68510291","pull_request_url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/comments/68510291"},"html":{"href":"https://github.com/pokotyamu/awesome_events/pull/20#discussion_r68510291"},"pull_request":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20","id":75206022,"html_url":"https://github.com/pokotyamu/awesome_events/pull/20","diff_url":"https://github.com/pokotyamu/awesome_events/pull/20.diff","patch_url":"https://github.com/pokotyamu/awesome_events/pull/20.patch","issue_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues/20","number":20,"state":"open","locked":false,"title":"リクエスト周りのテストのリファクタリング","user":{"login":"pokotyamu","id":3479317,"avatar_url":"https://avatars.githubusercontent.com/u/3479317?v=3","gravatar_id":"","url":"https://api.github.com/users/pokotyamu","html_url":"https://github.com/pokotyamu","followers_url":"https://api.github.com/users/pokotyamu/followers","following_url":"https://api.github.com/users/pokotyamu/following{/other_user}","gists_url":"https://api.github.com/users/pokotyamu/gists{/gist_id}","starred_url":"https://api.github.com/users/pokotyamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pokotyamu/subscriptions","organizations_url":"https://api.github.com/users/pokotyamu/orgs","repos_url":"https://api.github.com/users/pokotyamu/repos","events_url":"https://api.github.com/users/pokotyamu/events{/privacy}","received_events_url":"https://api.github.com/users/pokotyamu/received_events","type":"User","site_admin":false},"body":"#19 \r\n\r\n## PR の内容\r\n+ `Controller` の中でリクエストを検証しているテストが存在している\r\n\r\n### 何が問題なのか？\r\n+ そもそも、`Controller` の本質的な部分として、ルーティングは定義していないので、リクエストを検証している事自体が問題\r\n  + あくまで入出力という観点で`Controller` のテストを書くことに専念したい\r\n+ 今後、リクエストを拡張するたびに、`Controller` のテストに同じようなコードが増える\r\n\r\n### 解決策\r\n+ ` Request spec` を使う\r\n + [RequestのRSpecを実装する - PartyIX](http://h3poteto.hatenablog.com/entry/2015/03/12/160427)\r\n\r\n\r\n## やること\r\n+ [x] EventsController\r\n  + [x] GET #new\r\n  + [x] GET #edit\r\n  + [x] GET #show\r\n  + [x] POST #create\r\n  + [x] PATCH #update\r\n  + [x] DELETE #destroy\r\n+ [x] WelcomeController\r\n  + [x] GET #index","created_at":"2016-06-25T14:33:24Z","updated_at":"2016-06-26T21:40:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"619904bf7b0e4ba473690b555babcdd0e896b22f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20/commits","review_comments_url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20/comments","review_comment_url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues/20/comments","statuses_url":"https://api.github.com/repos/pokotyamu/awesome_events/statuses/e033838ca532ec4580a29b1153c34075c299edd8","head":{"label":"pokotyamu:refactor-request-spec","ref":"refactor-request-spec","sha":"e033838ca532ec4580a29b1153c34075c299edd8","user":{"login":"pokotyamu","id":3479317,"avatar_url":"https://avatars.githubusercontent.com/u/3479317?v=3","gravatar_id":"","url":"https://api.github.com/users/pokotyamu","html_url":"https://github.com/pokotyamu","followers_url":"https://api.github.com/users/pokotyamu/followers","following_url":"https://api.github.com/users/pokotyamu/following{/other_user}","gists_url":"https://api.github.com/users/pokotyamu/gists{/gist_id}","starred_url":"https://api.github.com/users/pokotyamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pokotyamu/subscriptions","organizations_url":"https://api.github.com/users/pokotyamu/orgs","repos_url":"https://api.github.com/users/pokotyamu/repos","events_url":"https://api.github.com/users/pokotyamu/events{/privacy}","received_events_url":"https://api.github.com/users/pokotyamu/received_events","type":"User","site_admin":false},"repo":{"id":59534994,"name":"awesome_events","full_name":"pokotyamu/awesome_events","owner":{"login":"pokotyamu","id":3479317,"avatar_url":"https://avatars.githubusercontent.com/u/3479317?v=3","gravatar_id":"","url":"https://api.github.com/users/pokotyamu","html_url":"https://github.com/pokotyamu","followers_url":"https://api.github.com/users/pokotyamu/followers","following_url":"https://api.github.com/users/pokotyamu/following{/other_user}","gists_url":"https://api.github.com/users/pokotyamu/gists{/gist_id}","starred_url":"https://api.github.com/users/pokotyamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pokotyamu/subscriptions","organizations_url":"https://api.github.com/users/pokotyamu/orgs","repos_url":"https://api.github.com/users/pokotyamu/repos","events_url":"https://api.github.com/users/pokotyamu/events{/privacy}","received_events_url":"https://api.github.com/users/pokotyamu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pokotyamu/awesome_events","description":"パrailsの研修用リポジトリ","fork":false,"url":"https://api.github.com/repos/pokotyamu/awesome_events","forks_url":"https://api.github.com/repos/pokotyamu/awesome_events/forks","keys_url":"https://api.github.com/repos/pokotyamu/awesome_events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pokotyamu/awesome_events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pokotyamu/awesome_events/teams","hooks_url":"https://api.github.com/repos/pokotyamu/awesome_events/hooks","issue_events_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues/events{/number}","events_url":"https://api.github.com/repos/pokotyamu/awesome_events/events","assignees_url":"https://api.github.com/repos/pokotyamu/awesome_events/assignees{/user}","branches_url":"https://api.github.com/repos/pokotyamu/awesome_events/branches{/branch}","tags_url":"https://api.github.com/repos/pokotyamu/awesome_events/tags","blobs_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/refs{/sha}","trees_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pokotyamu/awesome_events/statuses/{sha}","languages_url":"https://api.github.com/repos/pokotyamu/awesome_events/languages","stargazers_url":"https://api.github.com/repos/pokotyamu/awesome_events/stargazers","contributors_url":"https://api.github.com/repos/pokotyamu/awesome_events/contributors","subscribers_url":"https://api.github.com/repos/pokotyamu/awesome_events/subscribers","subscription_url":"https://api.github.com/repos/pokotyamu/awesome_events/subscription","commits_url":"https://api.github.com/repos/pokotyamu/awesome_events/commits{/sha}","git_commits_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/commits{/sha}","comments_url":"https://api.github.com/repos/pokotyamu/awesome_events/comments{/number}","issue_comment_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues/comments{/number}","contents_url":"https://api.github.com/repos/pokotyamu/awesome_events/contents/{+path}","compare_url":"https://api.github.com/repos/pokotyamu/awesome_events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pokotyamu/awesome_events/merges","archive_url":"https://api.github.com/repos/pokotyamu/awesome_events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pokotyamu/awesome_events/downloads","issues_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues{/number}","pulls_url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls{/number}","milestones_url":"https://api.github.com/repos/pokotyamu/awesome_events/milestones{/number}","notifications_url":"https://api.github.com/repos/pokotyamu/awesome_events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pokotyamu/awesome_events/labels{/name}","releases_url":"https://api.github.com/repos/pokotyamu/awesome_events/releases{/id}","deployments_url":"https://api.github.com/repos/pokotyamu/awesome_events/deployments","created_at":"2016-05-24T02:47:08Z","updated_at":"2016-05-25T11:17:35Z","pushed_at":"2016-06-26T06:52:14Z","git_url":"git://github.com/pokotyamu/awesome_events.git","ssh_url":"git@github.com:pokotyamu/awesome_events.git","clone_url":"https://github.com/pokotyamu/awesome_events.git","svn_url":"https://github.com/pokotyamu/awesome_events","homepage":null,"size":214,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"pokotyamu:master","ref":"master","sha":"f24e14347ddd111d1b97a00f76bd2c8bd75c118c","user":{"login":"pokotyamu","id":3479317,"avatar_url":"https://avatars.githubusercontent.com/u/3479317?v=3","gravatar_id":"","url":"https://api.github.com/users/pokotyamu","html_url":"https://github.com/pokotyamu","followers_url":"https://api.github.com/users/pokotyamu/followers","following_url":"https://api.github.com/users/pokotyamu/following{/other_user}","gists_url":"https://api.github.com/users/pokotyamu/gists{/gist_id}","starred_url":"https://api.github.com/users/pokotyamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pokotyamu/subscriptions","organizations_url":"https://api.github.com/users/pokotyamu/orgs","repos_url":"https://api.github.com/users/pokotyamu/repos","events_url":"https://api.github.com/users/pokotyamu/events{/privacy}","received_events_url":"https://api.github.com/users/pokotyamu/received_events","type":"User","site_admin":false},"repo":{"id":59534994,"name":"awesome_events","full_name":"pokotyamu/awesome_events","owner":{"login":"pokotyamu","id":3479317,"avatar_url":"https://avatars.githubusercontent.com/u/3479317?v=3","gravatar_id":"","url":"https://api.github.com/users/pokotyamu","html_url":"https://github.com/pokotyamu","followers_url":"https://api.github.com/users/pokotyamu/followers","following_url":"https://api.github.com/users/pokotyamu/following{/other_user}","gists_url":"https://api.github.com/users/pokotyamu/gists{/gist_id}","starred_url":"https://api.github.com/users/pokotyamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pokotyamu/subscriptions","organizations_url":"https://api.github.com/users/pokotyamu/orgs","repos_url":"https://api.github.com/users/pokotyamu/repos","events_url":"https://api.github.com/users/pokotyamu/events{/privacy}","received_events_url":"https://api.github.com/users/pokotyamu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pokotyamu/awesome_events","description":"パrailsの研修用リポジトリ","fork":false,"url":"https://api.github.com/repos/pokotyamu/awesome_events","forks_url":"https://api.github.com/repos/pokotyamu/awesome_events/forks","keys_url":"https://api.github.com/repos/pokotyamu/awesome_events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pokotyamu/awesome_events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pokotyamu/awesome_events/teams","hooks_url":"https://api.github.com/repos/pokotyamu/awesome_events/hooks","issue_events_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues/events{/number}","events_url":"https://api.github.com/repos/pokotyamu/awesome_events/events","assignees_url":"https://api.github.com/repos/pokotyamu/awesome_events/assignees{/user}","branches_url":"https://api.github.com/repos/pokotyamu/awesome_events/branches{/branch}","tags_url":"https://api.github.com/repos/pokotyamu/awesome_events/tags","blobs_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/refs{/sha}","trees_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pokotyamu/awesome_events/statuses/{sha}","languages_url":"https://api.github.com/repos/pokotyamu/awesome_events/languages","stargazers_url":"https://api.github.com/repos/pokotyamu/awesome_events/stargazers","contributors_url":"https://api.github.com/repos/pokotyamu/awesome_events/contributors","subscribers_url":"https://api.github.com/repos/pokotyamu/awesome_events/subscribers","subscription_url":"https://api.github.com/repos/pokotyamu/awesome_events/subscription","commits_url":"https://api.github.com/repos/pokotyamu/awesome_events/commits{/sha}","git_commits_url":"https://api.github.com/repos/pokotyamu/awesome_events/git/commits{/sha}","comments_url":"https://api.github.com/repos/pokotyamu/awesome_events/comments{/number}","issue_comment_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues/comments{/number}","contents_url":"https://api.github.com/repos/pokotyamu/awesome_events/contents/{+path}","compare_url":"https://api.github.com/repos/pokotyamu/awesome_events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pokotyamu/awesome_events/merges","archive_url":"https://api.github.com/repos/pokotyamu/awesome_events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pokotyamu/awesome_events/downloads","issues_url":"https://api.github.com/repos/pokotyamu/awesome_events/issues{/number}","pulls_url":"https://api.github.com/repos/pokotyamu/awesome_events/pulls{/number}","milestones_url":"https://api.github.com/repos/pokotyamu/awesome_events/milestones{/number}","notifications_url":"https://api.github.com/repos/pokotyamu/awesome_events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pokotyamu/awesome_events/labels{/name}","releases_url":"https://api.github.com/repos/pokotyamu/awesome_events/releases{/id}","deployments_url":"https://api.github.com/repos/pokotyamu/awesome_events/deployments","created_at":"2016-05-24T02:47:08Z","updated_at":"2016-05-25T11:17:35Z","pushed_at":"2016-06-26T06:52:14Z","git_url":"git://github.com/pokotyamu/awesome_events.git","ssh_url":"git@github.com:pokotyamu/awesome_events.git","clone_url":"https://github.com/pokotyamu/awesome_events.git","svn_url":"https://github.com/pokotyamu/awesome_events","homepage":null,"size":214,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20"},"html":{"href":"https://github.com/pokotyamu/awesome_events/pull/20"},"issue":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/issues/20"},"comments":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/pokotyamu/awesome_events/statuses/e033838ca532ec4580a29b1153c34075c299edd8"}}}}
{"actor":{"display_login":"a-know"}}