{"action":"created","comment":{"url":"https://api.github.com/repos/drkmen/employees/pulls/comments/193026961","pull_request_review_id":125914059,"id":193026961,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzAyNjk2MQ==","diff_hunk":"@@ -0,0 +1,229 @@\n+require 'rails_helper'\n+\n+RSpec.describe EmployeePolicy do\n+\n+  let(:other) { FactoryBot.create(:employee, :other) }\n+  let(:programmer) { FactoryBot.create(:employee, :programmer) }\n+  let(:manager) { FactoryBot.create(:employee, :manager) }\n+  let(:team_lead) { FactoryBot.create(:employee, :team_lead) }\n+  let(:admin) { FactoryBot.create(:employee, :admin) }\n+\n+  subject { described_class }\n+\n+  permissions :create?, :destroy? do\n+    it 'grants access if employee admin' do\n+      expect(subject).to permit(admin)\n+    end\n+\n+    it 'denies access if employee other' do\n+      expect(subject).not_to permit(other)\n+    end\n+\n+    it 'denies access if employee programmer' do\n+      expect(subject).not_to permit(programmer)\n+    end\n+\n+    it 'denies access if employee manager' do\n+      expect(subject).not_to permit(manager)\n+    end\n+\n+    it 'denies access if employee team_lead' do\n+      expect(subject).not_to permit(team_lead)\n+    end\n+\n+    it 'denies access if not employee' do\n+      expect(subject).not_to permit\n+    end\n+  end\n+\n+  permissions :update? do\n+    describe 'other edit employee' do\n+      it 'grants access if employee other edit self' do\n+        other = FactoryBot.create(:employee, :other)\n+        expect(subject).to permit(other, other)\n+      end\n+\n+      it 'denies access if employee other edit other employee other' do\n+        edit_other = Employee.create(first_name: Faker::Name.first_name,","path":"spec/policies/employee_policy_spec.rb","position":47,"original_position":47,"commit_id":"92fc9ae72df8be23e89849d6fa3246f9a6924dc7","original_commit_id":"92fc9ae72df8be23e89849d6fa3246f9a6924dc7","user":{"login":"drkmen","id":4477953,"node_id":"MDQ6VXNlcjQ0Nzc5NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4477953?v=4","gravatar_id":"","url":"https://api.github.com/users/drkmen","html_url":"https://github.com/drkmen","followers_url":"https://api.github.com/users/drkmen/followers","following_url":"https://api.github.com/users/drkmen/following{/other_user}","gists_url":"https://api.github.com/users/drkmen/gists{/gist_id}","starred_url":"https://api.github.com/users/drkmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkmen/subscriptions","organizations_url":"https://api.github.com/users/drkmen/orgs","repos_url":"https://api.github.com/users/drkmen/repos","events_url":"https://api.github.com/users/drkmen/events{/privacy}","received_events_url":"https://api.github.com/users/drkmen/received_events","type":"User","site_admin":false},"body":"Change all same creations ","created_at":"2018-06-05T10:45:05Z","updated_at":"2018-06-05T10:45:05Z","html_url":"https://github.com/drkmen/employees/pull/4#discussion_r193026961","pull_request_url":"https://api.github.com/repos/drkmen/employees/pulls/4","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/drkmen/employees/pulls/comments/193026961"},"html":{"href":"https://github.com/drkmen/employees/pull/4#discussion_r193026961"},"pull_request":{"href":"https://api.github.com/repos/drkmen/employees/pulls/4"}},"in_reply_to_id":193026231},"pull_request":{"url":"https://api.github.com/repos/drkmen/employees/pulls/4","id":191744090,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNzQ0MDkw","html_url":"https://github.com/drkmen/employees/pull/4","diff_url":"https://github.com/drkmen/employees/pull/4.diff","patch_url":"https://github.com/drkmen/employees/pull/4.patch","issue_url":"https://api.github.com/repos/drkmen/employees/issues/4","number":4,"state":"open","locked":false,"title":"Setup pundit","user":{"login":"Capitalsav","id":18749266,"node_id":"MDQ6VXNlcjE4NzQ5MjY2","avatar_url":"https://avatars0.githubusercontent.com/u/18749266?v=4","gravatar_id":"","url":"https://api.github.com/users/Capitalsav","html_url":"https://github.com/Capitalsav","followers_url":"https://api.github.com/users/Capitalsav/followers","following_url":"https://api.github.com/users/Capitalsav/following{/other_user}","gists_url":"https://api.github.com/users/Capitalsav/gists{/gist_id}","starred_url":"https://api.github.com/users/Capitalsav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capitalsav/subscriptions","organizations_url":"https://api.github.com/users/Capitalsav/orgs","repos_url":"https://api.github.com/users/Capitalsav/repos","events_url":"https://api.github.com/users/Capitalsav/events{/privacy}","received_events_url":"https://api.github.com/users/Capitalsav/received_events","type":"User","site_admin":false},"body":"Task: https://app.asana.com/0/691315813076158/691315813076169\r\nAdd pundit to project.\r\nGenerate default policies for models.\r\nCreate policies for models:\r\n\r\n- employee\r\n- image\r\n- resource_skill\r\n- project\r\n- skill\r\n\r\nMake tests for all polycies.\r\nAdd necessary enum-s.","created_at":"2018-05-31T12:52:30Z","updated_at":"2018-06-05T10:45:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5fcbceff63e4bfc1c0a4f48eca97dd86db6d3fd","assignee":{"login":"Capitalsav","id":18749266,"node_id":"MDQ6VXNlcjE4NzQ5MjY2","avatar_url":"https://avatars0.githubusercontent.com/u/18749266?v=4","gravatar_id":"","url":"https://api.github.com/users/Capitalsav","html_url":"https://github.com/Capitalsav","followers_url":"https://api.github.com/users/Capitalsav/followers","following_url":"https://api.github.com/users/Capitalsav/following{/other_user}","gists_url":"https://api.github.com/users/Capitalsav/gists{/gist_id}","starred_url":"https://api.github.com/users/Capitalsav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capitalsav/subscriptions","organizations_url":"https://api.github.com/users/Capitalsav/orgs","repos_url":"https://api.github.com/users/Capitalsav/repos","events_url":"https://api.github.com/users/Capitalsav/events{/privacy}","received_events_url":"https://api.github.com/users/Capitalsav/received_events","type":"User","site_admin":false},"assignees":[{"login":"Capitalsav","id":18749266,"node_id":"MDQ6VXNlcjE4NzQ5MjY2","avatar_url":"https://avatars0.githubusercontent.com/u/18749266?v=4","gravatar_id":"","url":"https://api.github.com/users/Capitalsav","html_url":"https://github.com/Capitalsav","followers_url":"https://api.github.com/users/Capitalsav/followers","following_url":"https://api.github.com/users/Capitalsav/following{/other_user}","gists_url":"https://api.github.com/users/Capitalsav/gists{/gist_id}","starred_url":"https://api.github.com/users/Capitalsav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Capitalsav/subscriptions","organizations_url":"https://api.github.com/users/Capitalsav/orgs","repos_url":"https://api.github.com/users/Capitalsav/repos","events_url":"https://api.github.com/users/Capitalsav/events{/privacy}","received_events_url":"https://api.github.com/users/Capitalsav/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/drkmen/employees/pulls/4/commits","review_comments_url":"https://api.github.com/repos/drkmen/employees/pulls/4/comments","review_comment_url":"https://api.github.com/repos/drkmen/employees/pulls/comments{/number}","comments_url":"https://api.github.com/repos/drkmen/employees/issues/4/comments","statuses_url":"https://api.github.com/repos/drkmen/employees/statuses/92fc9ae72df8be23e89849d6fa3246f9a6924dc7","head":{"label":"drkmen:setup_pundit","ref":"setup_pundit","sha":"92fc9ae72df8be23e89849d6fa3246f9a6924dc7","user":{"login":"drkmen","id":4477953,"node_id":"MDQ6VXNlcjQ0Nzc5NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4477953?v=4","gravatar_id":"","url":"https://api.github.com/users/drkmen","html_url":"https://github.com/drkmen","followers_url":"https://api.github.com/users/drkmen/followers","following_url":"https://api.github.com/users/drkmen/following{/other_user}","gists_url":"https://api.github.com/users/drkmen/gists{/gist_id}","starred_url":"https://api.github.com/users/drkmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkmen/subscriptions","organizations_url":"https://api.github.com/users/drkmen/orgs","repos_url":"https://api.github.com/users/drkmen/repos","events_url":"https://api.github.com/users/drkmen/events{/privacy}","received_events_url":"https://api.github.com/users/drkmen/received_events","type":"User","site_admin":false},"repo":{"id":135442234,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU0NDIyMzQ=","name":"employees","full_name":"drkmen/employees","owner":{"login":"drkmen","id":4477953,"node_id":"MDQ6VXNlcjQ0Nzc5NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4477953?v=4","gravatar_id":"","url":"https://api.github.com/users/drkmen","html_url":"https://github.com/drkmen","followers_url":"https://api.github.com/users/drkmen/followers","following_url":"https://api.github.com/users/drkmen/following{/other_user}","gists_url":"https://api.github.com/users/drkmen/gists{/gist_id}","starred_url":"https://api.github.com/users/drkmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkmen/subscriptions","organizations_url":"https://api.github.com/users/drkmen/orgs","repos_url":"https://api.github.com/users/drkmen/repos","events_url":"https://api.github.com/users/drkmen/events{/privacy}","received_events_url":"https://api.github.com/users/drkmen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drkmen/employees","description":null,"fork":false,"url":"https://api.github.com/repos/drkmen/employees","forks_url":"https://api.github.com/repos/drkmen/employees/forks","keys_url":"https://api.github.com/repos/drkmen/employees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drkmen/employees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drkmen/employees/teams","hooks_url":"https://api.github.com/repos/drkmen/employees/hooks","issue_events_url":"https://api.github.com/repos/drkmen/employees/issues/events{/number}","events_url":"https://api.github.com/repos/drkmen/employees/events","assignees_url":"https://api.github.com/repos/drkmen/employees/assignees{/user}","branches_url":"https://api.github.com/repos/drkmen/employees/branches{/branch}","tags_url":"https://api.github.com/repos/drkmen/employees/tags","blobs_url":"https://api.github.com/repos/drkmen/employees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drkmen/employees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drkmen/employees/git/refs{/sha}","trees_url":"https://api.github.com/repos/drkmen/employees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drkmen/employees/statuses/{sha}","languages_url":"https://api.github.com/repos/drkmen/employees/languages","stargazers_url":"https://api.github.com/repos/drkmen/employees/stargazers","contributors_url":"https://api.github.com/repos/drkmen/employees/contributors","subscribers_url":"https://api.github.com/repos/drkmen/employees/subscribers","subscription_url":"https://api.github.com/repos/drkmen/employees/subscription","commits_url":"https://api.github.com/repos/drkmen/employees/commits{/sha}","git_commits_url":"https://api.github.com/repos/drkmen/employees/git/commits{/sha}","comments_url":"https://api.github.com/repos/drkmen/employees/comments{/number}","issue_comment_url":"https://api.github.com/repos/drkmen/employees/issues/comments{/number}","contents_url":"https://api.github.com/repos/drkmen/employees/contents/{+path}","compare_url":"https://api.github.com/repos/drkmen/employees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drkmen/employees/merges","archive_url":"https://api.github.com/repos/drkmen/employees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drkmen/employees/downloads","issues_url":"https://api.github.com/repos/drkmen/employees/issues{/number}","pulls_url":"https://api.github.com/repos/drkmen/employees/pulls{/number}","milestones_url":"https://api.github.com/repos/drkmen/employees/milestones{/number}","notifications_url":"https://api.github.com/repos/drkmen/employees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drkmen/employees/labels{/name}","releases_url":"https://api.github.com/repos/drkmen/employees/releases{/id}","deployments_url":"https://api.github.com/repos/drkmen/employees/deployments","created_at":"2018-05-30T12:51:53Z","updated_at":"2018-05-31T09:04:06Z","pushed_at":"2018-06-05T10:01:03Z","git_url":"git://github.com/drkmen/employees.git","ssh_url":"git@github.com:drkmen/employees.git","clone_url":"https://github.com/drkmen/employees.git","svn_url":"https://github.com/drkmen/employees","homepage":null,"size":169,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"drkmen:development","ref":"development","sha":"f975af4d108633ae0a5f113b9aae441eb87192ac","user":{"login":"drkmen","id":4477953,"node_id":"MDQ6VXNlcjQ0Nzc5NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4477953?v=4","gravatar_id":"","url":"https://api.github.com/users/drkmen","html_url":"https://github.com/drkmen","followers_url":"https://api.github.com/users/drkmen/followers","following_url":"https://api.github.com/users/drkmen/following{/other_user}","gists_url":"https://api.github.com/users/drkmen/gists{/gist_id}","starred_url":"https://api.github.com/users/drkmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkmen/subscriptions","organizations_url":"https://api.github.com/users/drkmen/orgs","repos_url":"https://api.github.com/users/drkmen/repos","events_url":"https://api.github.com/users/drkmen/events{/privacy}","received_events_url":"https://api.github.com/users/drkmen/received_events","type":"User","site_admin":false},"repo":{"id":135442234,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU0NDIyMzQ=","name":"employees","full_name":"drkmen/employees","owner":{"login":"drkmen","id":4477953,"node_id":"MDQ6VXNlcjQ0Nzc5NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4477953?v=4","gravatar_id":"","url":"https://api.github.com/users/drkmen","html_url":"https://github.com/drkmen","followers_url":"https://api.github.com/users/drkmen/followers","following_url":"https://api.github.com/users/drkmen/following{/other_user}","gists_url":"https://api.github.com/users/drkmen/gists{/gist_id}","starred_url":"https://api.github.com/users/drkmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkmen/subscriptions","organizations_url":"https://api.github.com/users/drkmen/orgs","repos_url":"https://api.github.com/users/drkmen/repos","events_url":"https://api.github.com/users/drkmen/events{/privacy}","received_events_url":"https://api.github.com/users/drkmen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drkmen/employees","description":null,"fork":false,"url":"https://api.github.com/repos/drkmen/employees","forks_url":"https://api.github.com/repos/drkmen/employees/forks","keys_url":"https://api.github.com/repos/drkmen/employees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drkmen/employees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drkmen/employees/teams","hooks_url":"https://api.github.com/repos/drkmen/employees/hooks","issue_events_url":"https://api.github.com/repos/drkmen/employees/issues/events{/number}","events_url":"https://api.github.com/repos/drkmen/employees/events","assignees_url":"https://api.github.com/repos/drkmen/employees/assignees{/user}","branches_url":"https://api.github.com/repos/drkmen/employees/branches{/branch}","tags_url":"https://api.github.com/repos/drkmen/employees/tags","blobs_url":"https://api.github.com/repos/drkmen/employees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drkmen/employees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drkmen/employees/git/refs{/sha}","trees_url":"https://api.github.com/repos/drkmen/employees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drkmen/employees/statuses/{sha}","languages_url":"https://api.github.com/repos/drkmen/employees/languages","stargazers_url":"https://api.github.com/repos/drkmen/employees/stargazers","contributors_url":"https://api.github.com/repos/drkmen/employees/contributors","subscribers_url":"https://api.github.com/repos/drkmen/employees/subscribers","subscription_url":"https://api.github.com/repos/drkmen/employees/subscription","commits_url":"https://api.github.com/repos/drkmen/employees/commits{/sha}","git_commits_url":"https://api.github.com/repos/drkmen/employees/git/commits{/sha}","comments_url":"https://api.github.com/repos/drkmen/employees/comments{/number}","issue_comment_url":"https://api.github.com/repos/drkmen/employees/issues/comments{/number}","contents_url":"https://api.github.com/repos/drkmen/employees/contents/{+path}","compare_url":"https://api.github.com/repos/drkmen/employees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drkmen/employees/merges","archive_url":"https://api.github.com/repos/drkmen/employees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drkmen/employees/downloads","issues_url":"https://api.github.com/repos/drkmen/employees/issues{/number}","pulls_url":"https://api.github.com/repos/drkmen/employees/pulls{/number}","milestones_url":"https://api.github.com/repos/drkmen/employees/milestones{/number}","notifications_url":"https://api.github.com/repos/drkmen/employees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drkmen/employees/labels{/name}","releases_url":"https://api.github.com/repos/drkmen/employees/releases{/id}","deployments_url":"https://api.github.com/repos/drkmen/employees/deployments","created_at":"2018-05-30T12:51:53Z","updated_at":"2018-05-31T09:04:06Z","pushed_at":"2018-06-05T10:01:03Z","git_url":"git://github.com/drkmen/employees.git","ssh_url":"git@github.com:drkmen/employees.git","clone_url":"https://github.com/drkmen/employees.git","svn_url":"https://github.com/drkmen/employees","homepage":null,"size":169,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/drkmen/employees/pulls/4"},"html":{"href":"https://github.com/drkmen/employees/pull/4"},"issue":{"href":"https://api.github.com/repos/drkmen/employees/issues/4"},"comments":{"href":"https://api.github.com/repos/drkmen/employees/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/drkmen/employees/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/drkmen/employees/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/drkmen/employees/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/drkmen/employees/statuses/92fc9ae72df8be23e89849d6fa3246f9a6924dc7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"drkmen"}}