adds ability to confirm the hiding of comments, debates or users
This commit is contained in:
@@ -169,15 +169,34 @@ describe Ability do
|
||||
describe "Administrator" do
|
||||
let(:user) { create(:user) }
|
||||
before { create(:administrator, user: user) }
|
||||
let(:other_user) { create(:user) }
|
||||
|
||||
let(:other_user) { create(:user) }
|
||||
let(:hidden_user) { create(:user, :hidden) }
|
||||
|
||||
let(:hidden_debate) { create(:debate, :hidden) }
|
||||
let(:hidden_comment) { create(:comment, :hidden) }
|
||||
let(:own_debate) { create(:debate, author: user)}
|
||||
let(:own_comment) { create(:comment, author: user)}
|
||||
|
||||
it { should be_able_to(:index, Debate) }
|
||||
it { should be_able_to(:show, debate) }
|
||||
it { should be_able_to(:vote, debate) }
|
||||
|
||||
it { should be_able_to(:restore, comment) }
|
||||
it { should be_able_to(:restore, debate) }
|
||||
it { should be_able_to(:restore, other_user) }
|
||||
it { should_not be_able_to(:restore, comment) }
|
||||
it { should_not be_able_to(:restore, debate) }
|
||||
it { should_not be_able_to(:restore, other_user) }
|
||||
|
||||
it { should be_able_to(:restore, hidden_comment) }
|
||||
it { should be_able_to(:restore, hidden_debate) }
|
||||
it { should be_able_to(:restore, hidden_user) }
|
||||
|
||||
it { should_not be_able_to(:confirm_hide, comment) }
|
||||
it { should_not be_able_to(:confirm_hide, debate) }
|
||||
it { should_not be_able_to(:confirm_hide, other_user) }
|
||||
|
||||
it { should be_able_to(:confirm_hide, hidden_comment) }
|
||||
it { should be_able_to(:confirm_hide, hidden_debate) }
|
||||
it { should be_able_to(:confirm_hide, hidden_user) }
|
||||
|
||||
it { should be_able_to(:comment_as_administrator, debate) }
|
||||
it { should_not be_able_to(:comment_as_moderator, debate) }
|
||||
|
||||
Reference in New Issue
Block a user