Sha256: 140cb7f6aeefb7756dd643864bffc1fd57e4e84d2db979477cac00c91c29826f

Contents?: true

Size: 454 Bytes

Versions: 8

Compression:

Stored size: 454 Bytes

Contents

def default_user_setup
  @guest_user = User.create(:name => 'Guest user')  
  @guest_user.add_roles :guest
  @guest_user.save     
  
  @normal_user = User.create(:name => 'Normal user')
  @normal_user.roles = :guest, :user
  @normal_user.save  
  
  @admin_user = User.create(:name => 'Admin user')
  @admin_user.roles = :admin            
  @admin_user.save
  
  # puts "Admin roles: #{@admin_user.roles_list}, #{@admin_user.inspect}, #{Role.all}"
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
roles_active_record-0.4.6.3 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.6.2 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.6.1 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.6 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.5 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.4 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.3 spec/roles_active_record/strategy/user_setup.rb
roles_active_record-0.4.2 spec/roles_active_record/strategy/user_setup.rb