{"action":"created","comment":{"url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments/85620829","pull_request_review_id":6329658,"id":85620829,"diff_hunk":"@@ -0,0 +1,95 @@\n+require 'rails_helper'\n+\n+RSpec.describe BranchPolicy do\n+\n+  let(:agency) {FactoryGirl.create(:agency)}\n+  let(:agency1) {FactoryGirl.create(:agency)}\n+  let(:company){FactoryGirl.create(:company, agency: agency)}\n+  let(:branch) {FactoryGirl.create(:branch, agency: agency)}\n+  let(:jd)     {FactoryGirl.create(:job_developer, agency: agency)}\n+  let(:cm)     {FactoryGirl.create(:case_manager, agency: agency)}\n+  let(:admin)  {FactoryGirl.create(:agency_admin, agency: agency)}\n+  let(:jd1)     {FactoryGirl.create(:job_developer, agency: agency1)}\n+  let(:cm1)     {FactoryGirl.create(:case_manager, agency: agency1)}\n+  let(:admin1)  {FactoryGirl.create(:agency_admin, agency: agency1)}\n+  let(:company_admin) {FactoryGirl.create(:company_admin, company: company)}\n+  let(:company_contact) {FactoryGirl.create(:company_contact, company: company)}\n+  let(:js) {FactoryGirl.create(:job_seeker)}\n+ \n+  \n+\n+  permissions :new?, :create?, :edit?, :update?, :destroy? do\n+\n+    \n+    it 'denies access if user is job developer' do\n+      expect(BranchPolicy).not_to permit(jd, branch)\n+    end\n+   \n+    it 'denies access if user is case manager' do\n+      expect(BranchPolicy).not_to permit(cm, branch)\n+    end\n+\n+\n+    it 'allows access if user is an agency admin' do    \n+      expect(BranchPolicy).to permit(admin, branch)\n+    end\n+\n+    it 'denies access if user is an another agency job developer' do\n+      expect(BranchPolicy).not_to permit(jd1, branch)\n+    end\n+\n+    it 'denies access if user is an another agency case manager' do\n+      expect(BranchPolicy).not_to permit(cm1, branch)\n+    end\n+\n+\n+    it 'denies access if user is an another agency admin' do\n+      expect(BranchPolicy).not_to permit(admin1, branch)\n+\n+    end\n+\n+    it 'denies access if user is company admin' do\n+      expect(BranchPolicy).not_to permit(company_admin, branch)\n+    end\n+\n+    it 'denies access if user is company contact' do\n+      expect(BranchPolicy).not_to permit(company_contact, branch)\n+    end\n+    \n+    it 'denies access if user is jobseeker' do\n+      expect(BranchPolicy).not_to permit(js, branch)\n+    end\n+\n+  end\n+  \n+  permissions :show?  do\n+\n+    it 'allows access if user is an agency person' do\n+      expect(BranchPolicy).to permit(admin, branch)\n+      expect(BranchPolicy).to permit(jd, branch)\n+      expect(BranchPolicy).to permit(cm , branch)\n+    end\n+  \n+    it 'denies access if user is another agency person' do\n+      expect(BranchPolicy).not_to permit(admin1, branch)\n+      expect(BranchPolicy).not_to permit(jd1, branch)\n+      expect(BranchPolicy).not_to permit(cm1 , branch)","path":"spec/policies/branch_policy_spec.rb","position":76,"original_position":76,"commit_id":"af966d5ac3a434b30acced7f05d93c3ad97c3119","original_commit_id":"af966d5ac3a434b30acced7f05d93c3ad97c3119","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Space found before comma.","created_at":"2016-10-28T22:33:11Z","updated_at":"2016-10-28T22:33:11Z","html_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/393#discussion_r85620829","pull_request_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393","_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments/85620829"},"html":{"href":"https://github.com/AgileVentures/MetPlus_PETS/pull/393#discussion_r85620829"},"pull_request":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393"}}},"pull_request":{"url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393","id":87577767,"html_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/393","diff_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/393.diff","patch_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/393.patch","issue_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/393","number":393,"state":"open","locked":false,"title":"Pundit auth to branches controller 435","user":{"login":"vijayakarumudi","id":4852222,"avatar_url":"https://avatars.githubusercontent.com/u/4852222?v=3","gravatar_id":"","url":"https://api.github.com/users/vijayakarumudi","html_url":"https://github.com/vijayakarumudi","followers_url":"https://api.github.com/users/vijayakarumudi/followers","following_url":"https://api.github.com/users/vijayakarumudi/following{/other_user}","gists_url":"https://api.github.com/users/vijayakarumudi/gists{/gist_id}","starred_url":"https://api.github.com/users/vijayakarumudi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijayakarumudi/subscriptions","organizations_url":"https://api.github.com/users/vijayakarumudi/orgs","repos_url":"https://api.github.com/users/vijayakarumudi/repos","events_url":"https://api.github.com/users/vijayakarumudi/events{/privacy}","received_events_url":"https://api.github.com/users/vijayakarumudi/received_events","type":"User","site_admin":false},"body":"Closes AgileVentures/MetPlus_tracker#435.\r\n\r\n\r\n","created_at":"2016-09-30T22:47:12Z","updated_at":"2016-10-28T22:33:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ba16f31a70331c552e5629da43344765a07081d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/393/comments","statuses_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/statuses/af966d5ac3a434b30acced7f05d93c3ad97c3119","head":{"label":"vijayakarumudi:Pundit-auth-to-Branches-controller-435","ref":"Pundit-auth-to-Branches-controller-435","sha":"af966d5ac3a434b30acced7f05d93c3ad97c3119","user":{"login":"vijayakarumudi","id":4852222,"avatar_url":"https://avatars.githubusercontent.com/u/4852222?v=3","gravatar_id":"","url":"https://api.github.com/users/vijayakarumudi","html_url":"https://github.com/vijayakarumudi","followers_url":"https://api.github.com/users/vijayakarumudi/followers","following_url":"https://api.github.com/users/vijayakarumudi/following{/other_user}","gists_url":"https://api.github.com/users/vijayakarumudi/gists{/gist_id}","starred_url":"https://api.github.com/users/vijayakarumudi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijayakarumudi/subscriptions","organizations_url":"https://api.github.com/users/vijayakarumudi/orgs","repos_url":"https://api.github.com/users/vijayakarumudi/repos","events_url":"https://api.github.com/users/vijayakarumudi/events{/privacy}","received_events_url":"https://api.github.com/users/vijayakarumudi/received_events","type":"User","site_admin":false},"repo":{"id":44657000,"name":"MetPlus_PETS","full_name":"vijayakarumudi/MetPlus_PETS","owner":{"login":"vijayakarumudi","id":4852222,"avatar_url":"https://avatars.githubusercontent.com/u/4852222?v=3","gravatar_id":"","url":"https://api.github.com/users/vijayakarumudi","html_url":"https://github.com/vijayakarumudi","followers_url":"https://api.github.com/users/vijayakarumudi/followers","following_url":"https://api.github.com/users/vijayakarumudi/following{/other_user}","gists_url":"https://api.github.com/users/vijayakarumudi/gists{/gist_id}","starred_url":"https://api.github.com/users/vijayakarumudi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijayakarumudi/subscriptions","organizations_url":"https://api.github.com/users/vijayakarumudi/orgs","repos_url":"https://api.github.com/users/vijayakarumudi/repos","events_url":"https://api.github.com/users/vijayakarumudi/events{/privacy}","received_events_url":"https://api.github.com/users/vijayakarumudi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vijayakarumudi/MetPlus_PETS","description":"Front End for the MetPlus project","fork":true,"url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS","forks_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/forks","keys_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/teams","hooks_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/hooks","issue_events_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/issues/events{/number}","events_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/events","assignees_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/assignees{/user}","branches_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/branches{/branch}","tags_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/tags","blobs_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/git/refs{/sha}","trees_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/statuses/{sha}","languages_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/languages","stargazers_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/stargazers","contributors_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/contributors","subscribers_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/subscribers","subscription_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/subscription","commits_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/commits{/sha}","git_commits_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/git/commits{/sha}","comments_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/comments{/number}","issue_comment_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/issues/comments{/number}","contents_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/contents/{+path}","compare_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/merges","archive_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/downloads","issues_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/issues{/number}","pulls_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/pulls{/number}","milestones_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/milestones{/number}","notifications_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/labels{/name}","releases_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/releases{/id}","deployments_url":"https://api.github.com/repos/vijayakarumudi/MetPlus_PETS/deployments","created_at":"2015-10-21T06:29:41Z","updated_at":"2016-05-10T14:34:03Z","pushed_at":"2016-10-28T22:32:25Z","git_url":"git://github.com/vijayakarumudi/MetPlus_PETS.git","ssh_url":"git@github.com:vijayakarumudi/MetPlus_PETS.git","clone_url":"https://github.com/vijayakarumudi/MetPlus_PETS.git","svn_url":"https://github.com/vijayakarumudi/MetPlus_PETS","homepage":null,"size":2111,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"AgileVentures:development","ref":"development","sha":"ed58a4350323ca4fd5a76350854926cd61eb96fa","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":41921394,"name":"MetPlus_PETS","full_name":"AgileVentures/MetPlus_PETS","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/MetPlus_PETS","description":"Front End for the MetPlus project","fork":false,"url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS","forks_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/forks","keys_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/teams","hooks_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/events","assignees_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/tags","blobs_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/subscription","commits_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/merges","archive_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/downloads","issues_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/releases{/id}","deployments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/deployments","created_at":"2015-09-04T14:51:35Z","updated_at":"2016-10-23T02:06:36Z","pushed_at":"2016-10-28T22:32:26Z","git_url":"git://github.com/AgileVentures/MetPlus_PETS.git","ssh_url":"git@github.com:AgileVentures/MetPlus_PETS.git","clone_url":"https://github.com/AgileVentures/MetPlus_PETS.git","svn_url":"https://github.com/AgileVentures/MetPlus_PETS","homepage":null,"size":2725,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":6,"forks":32,"open_issues":6,"watchers":4,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393"},"html":{"href":"https://github.com/AgileVentures/MetPlus_PETS/pull/393"},"issue":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/393"},"comments":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/393/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/393/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/statuses/af966d5ac3a434b30acced7f05d93c3ad97c3119"}}}}
{"actor":{"display_login":"houndci-bot"}}