Use the vote action to vote featured proposals

The action and the views were almost identical, with the supports
progress and the HTML classes of the success message element being the
only exceptions; we can use CSS for the styles instead.
This commit is contained in:
Javi Martín
2021-09-28 20:02:41 +02:00
parent b98244afd9
commit 4b42a68b6a
14 changed files with 17 additions and 64 deletions

View File

@@ -69,7 +69,6 @@ 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) }
@@ -212,7 +211,6 @@ describe Abilities::Common do
describe "Proposal" do
it { should be_able_to(:vote, Proposal) }
it { should be_able_to(:vote_featured, Proposal) }
end
describe "Direct Message" do
@@ -292,7 +290,6 @@ describe Abilities::Common do
before { user.update(verified_at: Time.current) }
it { should be_able_to(:vote, Proposal) }
it { should be_able_to(:vote_featured, Proposal) }
it { should be_able_to(:new, DirectMessage) }
it { should be_able_to(:create, DirectMessage) }