Sha256: 306124d8e21cc188f696ad8720dc8df15e3f946f021efc6b207510e07560bb71

Contents?: true

Size: 1.38 KB

Versions: 6

Compression:

Stored size: 1.38 KB

Contents

describe Unidom::Party::Collaborating, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      collaboration_id:   SecureRandom.uuid,
      collaboration_type: 'Unidom::Party::Collaboration::Mock',
      collaborator_id:    SecureRandom.uuid,
      collaborator_type:  'Unidom::Party::Collaborator::Mock',
      role_code:          'ZZZZ',
      name:               'Attention',
      priority:           3,
      grade:              5
    }

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

    it_behaves_like 'validates text', model_attributes, :name, length: 2..described_class.columns_hash['name'].limit

    company_attributes           = { name: 'Tesla'   }
    government_agency_attributes = { name: 'CD Gov'  }
    person_attributes            = { name: 'Tim'     }
    shop_attributes              = { name: 'WalMart' }

    it_behaves_like 'belongs_to', model_attributes, :collaborator, Unidom::Party::Company,          company_attributes
    it_behaves_like 'belongs_to', model_attributes, :collaborator, Unidom::Party::GovernmentAgency, government_agency_attributes
    it_behaves_like 'belongs_to', model_attributes, :collaborator, Unidom::Party::Person,           person_attributes
    it_behaves_like 'belongs_to', model_attributes, :collaborator, Unidom::Party::Shop,             shop_attributes

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
unidom-party-2.0 lib/rspec/models/unidom/party/collaborating_spec.rb
unidom-party-1.9.8 lib/rspec/models/unidom/party/collaborating_spec.rb
unidom-party-1.9.7 lib/rspec/models/unidom/party/collaborating_spec.rb
unidom-party-1.9.6 lib/rspec/models/unidom/party/collaborating_spec.rb
unidom-party-1.9.5 lib/rspec/models/unidom/party/collaborating_spec.rb
unidom-party-1.9.4 lib/rspec/models/unidom/party/collaborating_spec.rb