adds new abilities

This commit is contained in:
Juanjo Bazán
2015-08-19 22:43:47 +02:00
committed by Juanjo Bazán
parent bd16e9345a
commit 259aa29de7
2 changed files with 7 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ describe Ability do
describe "Moderator" do
let(:user) { create(:user) }
before { create(:moderator, user: user) }
let(:other_user) { create(:user) }
it { should be_able_to(:index, Debate) }
it { should be_able_to(:show, debate) }
@@ -88,14 +89,17 @@ describe Ability do
it { should be_able_to(:hide, comment) }
it { should be_able_to(:hide, debate) }
it { should be_able_to(:hide, 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) }
end
describe "Administrator" do
let(:user) { create(:user) }
before { create(:administrator, user: user) }
let(:other_user) { create(:user) }
it { should be_able_to(:index, Debate) }
it { should be_able_to(:show, debate) }
@@ -103,5 +107,6 @@ describe Ability do
it { should be_able_to(:restore, comment) }
it { should be_able_to(:restore, debate) }
it { should be_able_to(:restore, other_user) }
end
end