From c896fc3eefc4b4a2c5c890ad91d86caf3086ae13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 22 Oct 2015 11:30:24 +0200 Subject: [PATCH] adds ability for featured_votes of proposals --- app/models/abilities/common.rb | 1 + spec/models/abilities/common_spec.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/models/abilities/common.rb b/app/models/abilities/common.rb index b8b951896..1b3a12f96 100644 --- a/app/models/abilities/common.rb +++ b/app/models/abilities/common.rb @@ -37,6 +37,7 @@ module Abilities if user.level_two_or_three_verified? can :vote, Proposal + can :vote_featured, Proposal end end diff --git a/spec/models/abilities/common_spec.rb b/spec/models/abilities/common_spec.rb index f15fb13c1..8e93f5bca 100644 --- a/spec/models/abilities/common_spec.rb +++ b/spec/models/abilities/common_spec.rb @@ -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