Sha256: 11ab8279ad56631427c1b3cefa739add675da621985cdebb6f3fd9e2cc54a8f2

Contents?: true

Size: 745 Bytes

Versions: 8

Compression:

Stored size: 745 Bytes

Contents

require 'spec_helper'

RSpec.describe Parent, type: :model do
  describe 'Associations' do
    it { is_expected.to have_many(:children).dependent(:destroy) }
    it { is_expected.to belong_to :grandmother }
    it { is_expected.to belong_to :grandfather }
  end

  describe 'Attributes' do
    it { is_expected.to respond_to :grandmother_id }
    it { is_expected.to respond_to :grandfather_id }
  end

  describe 'Database' do
    it { is_expected.to have_db_column(:grandmother_id).of_type(:integer) }
    it { is_expected.to have_db_column(:grandfather_id).of_type(:integer) }
  end

  describe 'Validations' do
    it { is_expected.to validate_presence_of :grandmother }
    it { is_expected.to validate_presence_of :grandfather }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
entangled-1.5.0 spec/models/parent_spec.rb
entangled-1.4.1 spec/models/parent_spec.rb
entangled-1.4.0 spec/models/parent_spec.rb
entangled-1.2.0 spec/models/parent_spec.rb
entangled-1.1.1 spec/models/parent_spec.rb
entangled-1.1.0 spec/models/parent_spec.rb
entangled-1.0.0 spec/models/parent_spec.rb
entangled-0.0.26 spec/models/parent_spec.rb