Created
November 10, 2008 02:10
-
-
Save benaskins/23405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/../spec_helper' | |
Machinist::load_blueprint :user | |
describe User do | |
describe 'Adam Administrator' do | |
before do | |
@adam = User.make(:role => "Administrator") | |
end | |
it 'can create administrators' do | |
@adam.can_create_user_with_role?("Administrator").should be_true | |
end | |
it 'can create site creators' do | |
@adam.can_create_user_with_role?("Site Creator").should be_true | |
end | |
it 'can create content editors' do | |
@adam.can_create_user_with_role?("Content Editor").should be_true | |
end | |
end | |
describe 'Sally Site Creator' do | |
before do | |
@adam = User.make(:role => "Site Creator") | |
end | |
it 'can not create administrators' do | |
@adam.can_create_user_with_role?("Administrator").should_not be_true | |
end | |
it 'can create site creators' do | |
@adam.can_create_user_with_role?("Site Creator").should be_true | |
end | |
it 'can create content editors' do | |
@adam.can_create_user_with_role?("Content Editor").should be_true | |
end | |
end | |
describe 'Eddy Content Editor' do | |
before do | |
@adam = User.make(:role => "Content Editor") | |
end | |
it 'can not create administrators' do | |
@adam.can_create_user_with_role?("Administrator").should_not be_true | |
end | |
it 'can not create site creators' do | |
@adam.can_create_user_with_role?("Site Creator").should_not be_true | |
end | |
it 'can create content editors' do | |
@adam.can_create_user_with_role?("Content Editor").should be_true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment