Adds abilities for verifying/rejecting organizations

This commit is contained in:
kikito
2015-08-12 17:48:25 +02:00
parent 5cef152c37
commit 450b0098c6
2 changed files with 21 additions and 0 deletions

View File

@@ -78,6 +78,20 @@ describe Ability do
it { should be_able_to(:show, debate) }
it { should be_able_to(:vote, debate) }
describe "organizations" do
let(:pending_organization) { create(:user, organization_name: 'org') }
let(:rejected_organization) { create(:user, organization_name: 'org', organization_rejected_at: Time.now)}
let(:verified_organization) { create(:user, organization_name: 'org', organization_verified_at: Time.now)}
it { should be_able_to( :verify_organization, pending_organization) }
it { should be_able_to( :reject_organization, pending_organization) }
it { should_not be_able_to(:verify_organization, verified_organization) }
it { should be_able_to( :reject_organization, verified_organization) }
it { should_not be_able_to(:reject_organization, rejected_organization) }
it { should be_able_to( :verify_organization, rejected_organization) }
end
end
describe "Administrator" do