Sha256: e9eee4c587f88e92dc39caa6556f7ec9e5168610e270c9db67703d07ee688094

Contents?: true

Size: 670 Bytes

Versions: 8

Compression:

Stored size: 670 Bytes

Contents

require 'spec_helper'

RSpec.describe Item, type: :model do
  describe 'Attributes' do
    it { is_expected.to respond_to :name }
    it { is_expected.to respond_to :complete }
    it { is_expected.to respond_to :list_id }
  end

  describe 'Database' do
    it { is_expected.to have_db_column :name }
    it { is_expected.to have_db_column(:complete).of_type(:boolean) }
    it { is_expected.to have_db_column(:list_id).of_type(:integer) }
  end

  describe 'Associations' do
    it { is_expected.to belong_to :list }
  end

  describe 'Validations' do
    it { is_expected.to validate_presence_of :list }
    it { is_expected.to validate_presence_of :name }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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