GitHub PullRequestReviewCommentEvent at 2014-09-26 10:00:12
Repository: openproject
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/opf/openproject/pulls/comments/18081779","id":18081779,"diff_hunk":"@@ -40,23 +40,74 @@\n   let(:status_1) { FactoryGirl.create(:status) }\n \n   context \"with an unauthorized account\" do\n-    let(:current_user) { nil }\n+    let(:current_user) { FactoryGirl.create(:user) }\n \n-    describe \"the access should be restricted\" do\n-      before { get 'index' }\n+    before do\n+      allow(User).to receive(:current).and_return(current_user)\n+    end\n+\n+    describe \"GET index\" do\n+      describe \"the access should be restricted\" do\n+        before { get 'index' }\n+\n+        it { expect(response.status).to eq(403) }\n+      end\n+    end\n+\n+    describe \"GET new\" do\n+      describe \"the access should be restricted\" do\n+        before { get 'new' }\n+\n+        it { expect(response.status).to eq(403) }\n+      end\n+    end\n+\n+    describe \"GET edit\" do\n+      describe \"the access should be restricted\" do\n+        before { get 'edit' }\n+\n+        it { expect(response.status).to eq(403) }\n+      end\n+    end\n \n-      it { expect(response.status).to eq(302) }\n-      it { expect(response).to redirect_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftypes' }\n+    describe \"POST create\" do\n+      describe \"the access should be restricted\" do\n+        before { post 'create' }\n+\n+        it { expect(response.status).to eq(403) }\n+      end\n+    end\n+\n+    describe \"DELETE destroy\" do\n+      describe \"the access should be restricted\" do\n+        before { delete 'destroy' }\n+\n+        it { expect(response.status).to eq(403) }\n+      end\n+    end\n+\n+    describe \"POST update\" do","path":"spec/controllers/types_controller_spec.rb","position":55,"original_position":55,"commit_id":"8699794db3bde391e928609a19e6e5948f53f802","original_commit_id":"8699794db3bde391e928609a19e6e5948f53f802","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=2","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2014-09-26T10:00:12Z","updated_at":"2014-09-26T10:00:12Z","html_url":"https://github.com/opf/openproject/pull/1957#discussion_r18081779","pull_request_url":"https://api.github.com/repos/opf/openproject/pulls/1957","_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/18081779"},"html":{"href":"https://github.com/opf/openproject/pull/1957#discussion_r18081779"},"pull_request":{"href":"https://api.github.com/repos/opf/openproject/pulls/1957"}}},"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/1957","id":21838854,"html_url":"https://github.com/opf/openproject/pull/1957","diff_url":"https://github.com/opf/openproject/pull/1957.diff","patch_url":"https://github.com/opf/openproject/pull/1957.patch","issue_url":"https://api.github.com/repos/opf/openproject/issues/1957","number":1957,"state":"open","locked":false,"title":"types controller is admin only now","user":{"login":"ulferts","id":617519,"avatar_url":"https://avatars.githubusercontent.com/u/617519?v=2","gravatar_id":"","url":"https://api.github.com/users/ulferts","html_url":"https://github.com/ulferts","followers_url":"https://api.github.com/users/ulferts/followers","following_url":"https://api.github.com/users/ulferts/following{/other_user}","gists_url":"https://api.github.com/users/ulferts/gists{/gist_id}","starred_url":"https://api.github.com/users/ulferts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulferts/subscriptions","organizations_url":"https://api.github.com/users/ulferts/orgs","repos_url":"https://api.github.com/users/ulferts/repos","events_url":"https://api.github.com/users/ulferts/events{/privacy}","received_events_url":"https://api.github.com/users/ulferts/received_events","type":"User","site_admin":false},"body":"https://www.openproject.org/work_packages/16266\r\n\r\nIt seems that the pagination in the timelines in now done via api/v2. So the necessity for allowing non admin access no longer exists.","created_at":"2014-09-26T10:00:07Z","updated_at":"2014-09-26T10:00:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf877f6c01b87d22fbf7a3265484be6fbcb76fe2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opf/openproject/pulls/1957/commits","review_comments_url":"https://api.github.com/repos/opf/openproject/pulls/1957/comments","review_comment_url":"https://api.github.com/repos/opf/openproject/pulls/comments/{number}","comments_url":"https://api.github.com/repos/opf/openproject/issues/1957/comments","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/8699794db3bde391e928609a19e6e5948f53f802","head":{"label":"opf:fix/types_no_longer_accessible_by_non_admins","ref":"fix/types_no_longer_accessible_by_non_admins","sha":"8699794db3bde391e928609a19e6e5948f53f802","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments/{number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2014-09-25T21:33:25Z","pushed_at":"2014-09-26T09:58:46Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":175378,"stargazers_count":340,"watchers_count":340,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":175,"mirror_url":null,"open_issues_count":42,"forks":175,"open_issues":42,"watchers":340,"default_branch":"dev"}},"base":{"label":"opf:dev","ref":"dev","sha":"1d4709bd87397233073dcc2eb666c80bcc164079","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments/{number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2014-09-25T21:33:25Z","pushed_at":"2014-09-26T09:58:46Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":175378,"stargazers_count":340,"watchers_count":340,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":175,"mirror_url":null,"open_issues_count":42,"forks":175,"open_issues":42,"watchers":340,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/1957"},"html":{"href":"https://github.com/opf/openproject/pull/1957"},"issue":{"href":"https://api.github.com/repos/opf/openproject/issues/1957"},"comments":{"href":"https://api.github.com/repos/opf/openproject/issues/1957/comments"},"review_comments":{"href":"https://api.github.com/repos/opf/openproject/pulls/1957/comments"},"review_comment":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/opf/openproject/pulls/1957/commits"},"statuses":{"href":"https://api.github.com/repos/opf/openproject/statuses/8699794db3bde391e928609a19e6e5948f53f802"}}}}