Sha256: 921bb5c9565afeccc91e5a462f238d712b0a1e594a202e45fc02f945afb4b616

Contents?: true

Size: 933 Bytes

Versions: 5

Compression:

Stored size: 933 Bytes

Contents

require 'spec_helper'
use_roles_strategy :role_string

class User
  include DataMapper::Resource  
  include Roles::DataMapper 
  
  strategy :role_string, :default
  property :id, Serial
  property :name, String   
end

DataMapper.finalize
DataMapper.auto_migrate!

User.valid_roles_are :admin, :guest, :user

# def api_migrate
#   migrate('roles_mask')
# end

def api_name
  :role_string
end

load 'roles_data_mapper/strategy/api_examples.rb'

# require 'spec_helper'
# use_roles_strategy :role_string
# 
# class User 
#   include DataMapper::Resource  
#   include Roles::DataMapper 
#   
#   strategy :role_string, :default
# 
#   property :id, Serial
#   property :name, String 
# end
# 
# DataMapper.finalize
# DataMapper.auto_migrate!
# 
# User.valid_roles_are :admin, :guest
# 
# describe "Roles for DataMapper: :role_string strategy" do
#   require "roles_data_mapper/user_setup"
#   require "roles_generic/rspec/api"
# end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roles_data_mapper-0.3.1 spec/roles_data_mapper/strategy/single/role_string_spec.rb
roles_data_mapper-0.3.0 spec/roles_data_mapper/strategy/single/role_string_spec.rb
roles_data_mapper-0.2.2 spec/roles_data_mapper/strategy/single/role_string_spec.rb
roles_data_mapper-0.2.1 spec/roles_data_mapper/strategy/single/role_string_spec.rb
roles_data_mapper-0.2.0 spec/roles_data_mapper/strategy/single/role_string_spec.rb