Sha256: 89860eefc75044e1535cba53e84c2a693f80de58aa4120d6a9f7da5739f2056c
Contents?: true
Size: 654 Bytes
Versions: 41
Compression:
Stored size: 654 Bytes
Contents
require 'spec_helper' describe AccountRole do subject { user = Fabricate( :user ) user.account_users.first.roles.destroy_all @account_user = user.account_users.first Fabricate( :account_role, :account_user => @account_user ) } it { should belong_to :account_user } it { should validate_uniqueness_of(:name).scoped_to(:account_user_id) } it { should validate_presence_of(:account_user) } it 'should only accept configured roles' do subject.name = "not a role" subject.should_not be_valid end it 'roles class method should return available roles' do AccountRole.roles.should == APP_ROLES['roles'] end end
Version data entries
41 entries across 41 versions & 1 rubygems