Sha256: 2f780ecab294f618fedc23599f9f6856385f42ec6dff28681e43788137ad5833

Contents?: true

Size: 916 Bytes

Versions: 1

Compression:

Stored size: 916 Bytes

Contents

describe Unidom::Contact::ContactSubscription, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      contact_id:      SecureRandom.uuid,
      contact_type:    'Unidom::Contact::Contact::Mock',
      subscriber_id:   SecureRandom.uuid,
      subscriber_type: 'Unidom::Contact::Subscriber::Mock',
      name:            'Home'
    }

    name_max_length = described_class.columns_hash['name'].limit

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

    it_behaves_like 'validates', model_attributes, :name,
      {             } => 0,
      { name: nil   } => 2,
      { name: ''    } => 2,
      { name: 'A'   } => 1,
      { name: 'Al'  } => 0,
      { name: 'Bob' } => 0,
      { name: 'A'*(name_max_length-1)  } => 0,
      { name: 'A'*name_max_length      } => 0,
      { name: 'A'*(name_max_length+1)  } => 1

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-contact-1.4.1 lib/rspec/models/unidom/contact/contact_subscription_spec.rb