{"action":"created","comment":{"url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/comments/146552676","pull_request_review_id":71510056,"id":146552676,"diff_hunk":"@@ -78,6 +78,18 @@ describe AnnouncementController do\n       expect(response.status_code).to eq 200\n       expect(response.body.includes? \"Make an Announcement\").to be_true\n     end\n+\n+    context \"rate limit reached\" do\n+      before { login_as user }\n+\n+      it \"shows rate limit message\" do\n+        ENV[\"MAX_ANNS_PER_HOUR\"] = \"0\"\n+        get \"/announcements/new\"\n+        expect(response.status_code).to eq 200\n+        expect(response.body.includes? \"You can create up to\").to be_true\n+        ENV[\"MAX_ANNS_PER_HOUR\"] = nil","path":"spec/controllers/announcement_controller_spec.cr","position":13,"original_position":13,"commit_id":"f6aca59bbd2183bcac417dcb293c7bfc442bec5f","original_commit_id":"f6aca59bbd2183bcac417dcb293c7bfc442bec5f","user":{"login":"veelenga","id":3624712,"avatar_url":"https://avatars2.githubusercontent.com/u/3624712?v=4","gravatar_id":"","url":"https://api.github.com/users/veelenga","html_url":"https://github.com/veelenga","followers_url":"https://api.github.com/users/veelenga/followers","following_url":"https://api.github.com/users/veelenga/following{/other_user}","gists_url":"https://api.github.com/users/veelenga/gists{/gist_id}","starred_url":"https://api.github.com/users/veelenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veelenga/subscriptions","organizations_url":"https://api.github.com/users/veelenga/orgs","repos_url":"https://api.github.com/users/veelenga/repos","events_url":"https://api.github.com/users/veelenga/events{/privacy}","received_events_url":"https://api.github.com/users/veelenga/received_events","type":"User","site_admin":false},"body":"With https://github.com/crystal-lang/crystal/pull/5114 it will be possible to do:\r\n\r\n```crystal\r\n      it \"shows rate limit message\" do\r\n        ENV[\"MAX_ANNS_PER_HOUR\"] = \"0\"\r\n        get \"/announcements/new\"\r\n        expect(response.status_code).to eq 200\r\n        expect(response.body.includes? \"You can create up to\").to be_true\r\n      ensure\r\n        ENV[\"MAX_ANNS_PER_HOUR\"] = nil\r\n      end\r\n```\r\n\r\nwhich is quite nice :)","created_at":"2017-10-24T13:07:18Z","updated_at":"2017-10-24T13:07:19Z","html_url":"https://github.com/crystal-community/crystal-ann/pull/60#discussion_r146552676","pull_request_url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/comments/146552676"},"html":{"href":"https://github.com/crystal-community/crystal-ann/pull/60#discussion_r146552676"},"pull_request":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60"}},"in_reply_to_id":146375227},"pull_request":{"url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60","id":148177875,"html_url":"https://github.com/crystal-community/crystal-ann/pull/60","diff_url":"https://github.com/crystal-community/crystal-ann/pull/60.diff","patch_url":"https://github.com/crystal-community/crystal-ann/pull/60.patch","issue_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues/60","number":60,"state":"open","locked":false,"title":"Max announcements per hour","user":{"login":"hugoabonizio","id":1206395,"avatar_url":"https://avatars0.githubusercontent.com/u/1206395?v=4","gravatar_id":"","url":"https://api.github.com/users/hugoabonizio","html_url":"https://github.com/hugoabonizio","followers_url":"https://api.github.com/users/hugoabonizio/followers","following_url":"https://api.github.com/users/hugoabonizio/following{/other_user}","gists_url":"https://api.github.com/users/hugoabonizio/gists{/gist_id}","starred_url":"https://api.github.com/users/hugoabonizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hugoabonizio/subscriptions","organizations_url":"https://api.github.com/users/hugoabonizio/orgs","repos_url":"https://api.github.com/users/hugoabonizio/repos","events_url":"https://api.github.com/users/hugoabonizio/events{/privacy}","received_events_url":"https://api.github.com/users/hugoabonizio/received_events","type":"User","site_admin":false},"body":"I added an error message to announcement form page when limit is reached too.\r\n\r\n![](https://user-images.githubusercontent.com/1206395/31900517-6928b1d2-b7fd-11e7-9767-84892b68eda4.png)\r\n\r\nFixes #55 ","created_at":"2017-10-23T16:21:44Z","updated_at":"2017-10-24T13:07:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be67b8697301e5e69ae691c5fa20fd88b8d4dbef","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60/commits","review_comments_url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60/comments","review_comment_url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues/60/comments","statuses_url":"https://api.github.com/repos/crystal-community/crystal-ann/statuses/f6aca59bbd2183bcac417dcb293c7bfc442bec5f","head":{"label":"crystal-community:feat/max-hourly-quota","ref":"feat/max-hourly-quota","sha":"f6aca59bbd2183bcac417dcb293c7bfc442bec5f","user":{"login":"crystal-community","id":30921794,"avatar_url":"https://avatars0.githubusercontent.com/u/30921794?v=4","gravatar_id":"","url":"https://api.github.com/users/crystal-community","html_url":"https://github.com/crystal-community","followers_url":"https://api.github.com/users/crystal-community/followers","following_url":"https://api.github.com/users/crystal-community/following{/other_user}","gists_url":"https://api.github.com/users/crystal-community/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-community/subscriptions","organizations_url":"https://api.github.com/users/crystal-community/orgs","repos_url":"https://api.github.com/users/crystal-community/repos","events_url":"https://api.github.com/users/crystal-community/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-community/received_events","type":"Organization","site_admin":false},"repo":{"id":96698413,"name":"crystal-ann","full_name":"crystal-community/crystal-ann","owner":{"login":"crystal-community","id":30921794,"avatar_url":"https://avatars0.githubusercontent.com/u/30921794?v=4","gravatar_id":"","url":"https://api.github.com/users/crystal-community","html_url":"https://github.com/crystal-community","followers_url":"https://api.github.com/users/crystal-community/followers","following_url":"https://api.github.com/users/crystal-community/following{/other_user}","gists_url":"https://api.github.com/users/crystal-community/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-community/subscriptions","organizations_url":"https://api.github.com/users/crystal-community/orgs","repos_url":"https://api.github.com/users/crystal-community/repos","events_url":"https://api.github.com/users/crystal-community/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-community/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crystal-community/crystal-ann","description":"Web site to announce new Crystal projects, blog posts, updates and other work activities","fork":false,"url":"https://api.github.com/repos/crystal-community/crystal-ann","forks_url":"https://api.github.com/repos/crystal-community/crystal-ann/forks","keys_url":"https://api.github.com/repos/crystal-community/crystal-ann/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crystal-community/crystal-ann/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crystal-community/crystal-ann/teams","hooks_url":"https://api.github.com/repos/crystal-community/crystal-ann/hooks","issue_events_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues/events{/number}","events_url":"https://api.github.com/repos/crystal-community/crystal-ann/events","assignees_url":"https://api.github.com/repos/crystal-community/crystal-ann/assignees{/user}","branches_url":"https://api.github.com/repos/crystal-community/crystal-ann/branches{/branch}","tags_url":"https://api.github.com/repos/crystal-community/crystal-ann/tags","blobs_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/refs{/sha}","trees_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crystal-community/crystal-ann/statuses/{sha}","languages_url":"https://api.github.com/repos/crystal-community/crystal-ann/languages","stargazers_url":"https://api.github.com/repos/crystal-community/crystal-ann/stargazers","contributors_url":"https://api.github.com/repos/crystal-community/crystal-ann/contributors","subscribers_url":"https://api.github.com/repos/crystal-community/crystal-ann/subscribers","subscription_url":"https://api.github.com/repos/crystal-community/crystal-ann/subscription","commits_url":"https://api.github.com/repos/crystal-community/crystal-ann/commits{/sha}","git_commits_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/commits{/sha}","comments_url":"https://api.github.com/repos/crystal-community/crystal-ann/comments{/number}","issue_comment_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues/comments{/number}","contents_url":"https://api.github.com/repos/crystal-community/crystal-ann/contents/{+path}","compare_url":"https://api.github.com/repos/crystal-community/crystal-ann/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crystal-community/crystal-ann/merges","archive_url":"https://api.github.com/repos/crystal-community/crystal-ann/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crystal-community/crystal-ann/downloads","issues_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues{/number}","pulls_url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls{/number}","milestones_url":"https://api.github.com/repos/crystal-community/crystal-ann/milestones{/number}","notifications_url":"https://api.github.com/repos/crystal-community/crystal-ann/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crystal-community/crystal-ann/labels{/name}","releases_url":"https://api.github.com/repos/crystal-community/crystal-ann/releases{/id}","deployments_url":"https://api.github.com/repos/crystal-community/crystal-ann/deployments","created_at":"2017-07-09T17:00:13Z","updated_at":"2017-10-17T17:41:32Z","pushed_at":"2017-10-23T16:21:45Z","git_url":"git://github.com/crystal-community/crystal-ann.git","ssh_url":"git@github.com:crystal-community/crystal-ann.git","clone_url":"https://github.com/crystal-community/crystal-ann.git","svn_url":"https://github.com/crystal-community/crystal-ann","homepage":"https://crystal-ann.com","size":1223,"stargazers_count":18,"watchers_count":18,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":18,"default_branch":"master"}},"base":{"label":"crystal-community:master","ref":"master","sha":"8353f604f319c7a22a60530cb8d6cd93c9dc7efe","user":{"login":"crystal-community","id":30921794,"avatar_url":"https://avatars0.githubusercontent.com/u/30921794?v=4","gravatar_id":"","url":"https://api.github.com/users/crystal-community","html_url":"https://github.com/crystal-community","followers_url":"https://api.github.com/users/crystal-community/followers","following_url":"https://api.github.com/users/crystal-community/following{/other_user}","gists_url":"https://api.github.com/users/crystal-community/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-community/subscriptions","organizations_url":"https://api.github.com/users/crystal-community/orgs","repos_url":"https://api.github.com/users/crystal-community/repos","events_url":"https://api.github.com/users/crystal-community/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-community/received_events","type":"Organization","site_admin":false},"repo":{"id":96698413,"name":"crystal-ann","full_name":"crystal-community/crystal-ann","owner":{"login":"crystal-community","id":30921794,"avatar_url":"https://avatars0.githubusercontent.com/u/30921794?v=4","gravatar_id":"","url":"https://api.github.com/users/crystal-community","html_url":"https://github.com/crystal-community","followers_url":"https://api.github.com/users/crystal-community/followers","following_url":"https://api.github.com/users/crystal-community/following{/other_user}","gists_url":"https://api.github.com/users/crystal-community/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-community/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-community/subscriptions","organizations_url":"https://api.github.com/users/crystal-community/orgs","repos_url":"https://api.github.com/users/crystal-community/repos","events_url":"https://api.github.com/users/crystal-community/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-community/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crystal-community/crystal-ann","description":"Web site to announce new Crystal projects, blog posts, updates and other work activities","fork":false,"url":"https://api.github.com/repos/crystal-community/crystal-ann","forks_url":"https://api.github.com/repos/crystal-community/crystal-ann/forks","keys_url":"https://api.github.com/repos/crystal-community/crystal-ann/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crystal-community/crystal-ann/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crystal-community/crystal-ann/teams","hooks_url":"https://api.github.com/repos/crystal-community/crystal-ann/hooks","issue_events_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues/events{/number}","events_url":"https://api.github.com/repos/crystal-community/crystal-ann/events","assignees_url":"https://api.github.com/repos/crystal-community/crystal-ann/assignees{/user}","branches_url":"https://api.github.com/repos/crystal-community/crystal-ann/branches{/branch}","tags_url":"https://api.github.com/repos/crystal-community/crystal-ann/tags","blobs_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/refs{/sha}","trees_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crystal-community/crystal-ann/statuses/{sha}","languages_url":"https://api.github.com/repos/crystal-community/crystal-ann/languages","stargazers_url":"https://api.github.com/repos/crystal-community/crystal-ann/stargazers","contributors_url":"https://api.github.com/repos/crystal-community/crystal-ann/contributors","subscribers_url":"https://api.github.com/repos/crystal-community/crystal-ann/subscribers","subscription_url":"https://api.github.com/repos/crystal-community/crystal-ann/subscription","commits_url":"https://api.github.com/repos/crystal-community/crystal-ann/commits{/sha}","git_commits_url":"https://api.github.com/repos/crystal-community/crystal-ann/git/commits{/sha}","comments_url":"https://api.github.com/repos/crystal-community/crystal-ann/comments{/number}","issue_comment_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues/comments{/number}","contents_url":"https://api.github.com/repos/crystal-community/crystal-ann/contents/{+path}","compare_url":"https://api.github.com/repos/crystal-community/crystal-ann/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crystal-community/crystal-ann/merges","archive_url":"https://api.github.com/repos/crystal-community/crystal-ann/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crystal-community/crystal-ann/downloads","issues_url":"https://api.github.com/repos/crystal-community/crystal-ann/issues{/number}","pulls_url":"https://api.github.com/repos/crystal-community/crystal-ann/pulls{/number}","milestones_url":"https://api.github.com/repos/crystal-community/crystal-ann/milestones{/number}","notifications_url":"https://api.github.com/repos/crystal-community/crystal-ann/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crystal-community/crystal-ann/labels{/name}","releases_url":"https://api.github.com/repos/crystal-community/crystal-ann/releases{/id}","deployments_url":"https://api.github.com/repos/crystal-community/crystal-ann/deployments","created_at":"2017-07-09T17:00:13Z","updated_at":"2017-10-17T17:41:32Z","pushed_at":"2017-10-23T16:21:45Z","git_url":"git://github.com/crystal-community/crystal-ann.git","ssh_url":"git@github.com:crystal-community/crystal-ann.git","clone_url":"https://github.com/crystal-community/crystal-ann.git","svn_url":"https://github.com/crystal-community/crystal-ann","homepage":"https://crystal-ann.com","size":1223,"stargazers_count":18,"watchers_count":18,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60"},"html":{"href":"https://github.com/crystal-community/crystal-ann/pull/60"},"issue":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/issues/60"},"comments":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/crystal-community/crystal-ann/statuses/f6aca59bbd2183bcac417dcb293c7bfc442bec5f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"veelenga"}}