Sha256: 0677b69aaeb5fd07d34e4d1a2bb11b9fe638b5cb24dc3b50344b9bb949b4ff63

Contents?: true

Size: 756 Bytes

Versions: 5

Compression:

Stored size: 756 Bytes

Contents

require "active_record/strategy_helper"
require "active_record/migrations/one/bit_one"

def migrate_up
  CreateBitOne.up # run migration
end

def migrate_down
  CreateBitOne.down
end      

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

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

  def create_user
    Factory.create :user, :name => 'normal', :trole => false
  end

  def create_admin_user
    Factory.create :user, :name => 'admin', :trole => true
  end
end

require 'troles/common/api_spec' # Common API examples  

describe 'Troles strategy :bit_one' do  
  it_should_behave_like "Common API"
  # it_should_behave_like "Troles API"  
end    

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
troles-0.6.1 spec/active_record/strategies/one/bit_one_spec.rb
troles-0.6.0 spec/active_record/strategies/one/bit_one_spec.rb
troles-0.5.2 spec/active_record/strategies/one/bit_one_spec.rb
troles-0.5.1 spec/active_record/strategies/one/bit_one_spec.rb
troles-0.5.0 spec/active_record/strategies/one/bit_one_spec.rb