From 854b60bc8c3cd96f15b2ba0bd08ba86b11031129 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Thu, 2 Mar 2017 10:27:43 -0600 Subject: [PATCH] policy update --- app/policies/reviewer_vote_policy.rb | 8 +------- test/policies/reviewer_vote_policy_test.rb | 10 +--------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/policies/reviewer_vote_policy.rb b/app/policies/reviewer_vote_policy.rb index 00f28a7..a5d2193 100644 --- a/app/policies/reviewer_vote_policy.rb +++ b/app/policies/reviewer_vote_policy.rb @@ -21,13 +21,7 @@ class ReviewerVotePolicy < ApplicationPolicy user.acts_as_reviewer? end - def approve? - return true if user.acts_as_admin? - return false unless record.candidate.reviewers.include? user - user.acts_as_manager? - end - - def decline? + def interview_request? return true if user.acts_as_admin? return false unless record.candidate.reviewers.include? user user.acts_as_manager? diff --git a/test/policies/reviewer_vote_policy_test.rb b/test/policies/reviewer_vote_policy_test.rb index 95c8e82..e529e10 100644 --- a/test/policies/reviewer_vote_policy_test.rb +++ b/test/policies/reviewer_vote_policy_test.rb @@ -48,15 +48,7 @@ class ReviewerVotePolicyTest < PolicyAssertions::Test refute_permit users(:manager), reviewer_votes(:gustov) end - def approve - assert_permit users(:manager), reviewer_votes(:manager_richard) - assert_permit users(:admin), reviewer_votes(:manager_henry) - - refute_permit users(:recruiter), reviewer_votes(:manager_henry) - refute_permit users(:reviewer), reviewer_votes(:reviewer_richard) - end - - def decline + def interview_request assert_permit users(:manager), reviewer_votes(:manager_richard) assert_permit users(:admin), reviewer_votes(:manager_henry)