adds ability for featured_votes of proposals

This commit is contained in:
Juanjo Bazán
2015-10-22 11:30:24 +02:00
committed by Juanjo Bazán
parent 65ed1f45ab
commit c896fc3eef
2 changed files with 4 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ module Abilities
if user.level_two_or_three_verified?
can :vote, Proposal
can :vote_featured, Proposal
end
end

View File

@@ -26,6 +26,7 @@ describe "Abilities::Common" do
it { should be_able_to(:index, Proposal) }
it { should be_able_to(:show, proposal) }
it { should_not be_able_to(:vote, Proposal) }
it { should_not be_able_to(:vote_featured, Proposal) }
it { should_not be_able_to(:comment_as_administrator, debate) }
it { should_not be_able_to(:comment_as_moderator, debate) }
@@ -82,11 +83,13 @@ describe "Abilities::Common" do
before{ user.update(residence_verified_at: Time.now, confirmed_phone: "1") }
it { should be_able_to(:vote, Proposal) }
it { should be_able_to(:vote_featured, Proposal) }
end
describe "when level 3 verified" do
before{ user.update(verified_at: Time.now) }
it { should be_able_to(:vote, Proposal) }
it { should be_able_to(:vote_featured, Proposal) }
end
end