Allow users to delete their own comments

This commit is contained in:
Julian Herrero
2020-09-24 11:53:48 +07:00
committed by Javi Martín
parent fa14976cfd
commit 0698c0ff4f
12 changed files with 100 additions and 8 deletions

View File

@@ -65,9 +65,6 @@ describe Abilities::Common do
it { should be_able_to(:show, user) }
it { should be_able_to(:edit, user) }
it { should be_able_to(:create, Comment) }
it { should be_able_to(:vote, Comment) }
it { should be_able_to(:index, Proposal) }
it { should be_able_to(:show, proposal) }
it { should_not be_able_to(:vote, Proposal) }
@@ -97,6 +94,14 @@ describe Abilities::Common do
it { should_not be_able_to(:manage, LocalCensusRecord) }
describe "Comment" do
it { should be_able_to(:create, Comment) }
it { should be_able_to(:vote, Comment) }
it { should be_able_to(:hide, own_comment) }
it { should_not be_able_to(:hide, comment) }
end
describe "flagging content" do
it { should be_able_to(:flag, debate) }
it { should be_able_to(:unflag, debate) }