Sha256: c8f3171b93c785f692adcd82e087d02432925f8d1dbc4109945d751fd332ea84
Contents?: true
Size: 501 Bytes
Versions: 1
Compression:
Stored size: 501 Bytes
Contents
def migrate_up migrate :ref_many end require 'active_record_helper' require 'troles_spec' User.troles_strategy :ref_many do |c| c.valid_roles = [:user, :admin, :blogger] end.configure! describe Troles::Storage::RefMany do let(:kris) { Factory.create :user } subject { Troles::Storage::RefMany.new kris } it 'should set roles' do subject.set_roles 'blogger', 'admin' subject.display_roles.should == [:blogger, :admin] kris.troles.first.should == Role.first end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
troles-0.6.1 | spec/troles/storage/ref_many_spec.rb |