Sha256: e6d2b7d9926e20bf09dd7f0ca23d5dd30e96ae0ce51208ef8f2438e864fbc27c

Contents?: true

Size: 683 Bytes

Versions: 2

Compression:

Stored size: 683 Bytes

Contents

require 'strategy_helper'

User.troles_strategy :bit_many do |c|
  c.valid_roles = [:user, :admin, :blogger, :editor]
end.configure!

module UserSetup
  def create_no_roles_user
    Factory.create :user, :name => 'no roles', :troles => 0
  end

  def create_user
    Factory.create :user, :name => 'normal', :troles => 1
  end

  def create_admin_user
    Factory.create :user, :name => 'admin', :troles => 2
  end

  def create_complex_user
    Factory.create :user, :name => 'user and admin', :troles => 3
  end
end

describe 'Troles strategy bit_many' do
  it_behaves_like "Common API"
  it_behaves_like "Common API for multiple roles"  

  it_behaves_like "Troles API"  
end    

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troles-0.5.1 spec/troles/strategies/bit_many_spec.rb
troles-0.5.0 spec/troles/strategies/bit_many_spec.rb