Sha256: 05448584642f43d23a94d904eb90c88c8ce62628a5bb78b4c224ea46ca1d996f

Contents?: true

Size: 759 Bytes

Versions: 9

Compression:

Stored size: 759 Bytes

Contents

require 'rails_helper'

module Logistics
  module Core
    RSpec.describe ExtendedLookup, type: :model do
      it 'has a valid factory' do
        expect(create(:extended_lookup)).to be_valid
      end

      it 'is invalid with no code' do
        expect(build(:extended_lookup, :code => nil)).not_to be_valid
      end

      it 'is invalid with no name' do
        expect(build(:extended_lookup, :name => nil)).not_to be_valid
      end

      it 'is invalid with no type' do
        expect(build(:extended_lookup, type: nil)).not_to be_valid
      end

      it 'is invalid with duplicate code and type' do
        lookup = create(:extended_lookup)
        expect(build(:extended_lookup, :code => lookup.code)).not_to be_valid
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logistics_core-21.11.2 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-21.11.1 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-21.08.1 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-21.03.1 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-20.10.3 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-20.10.2 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-20.10.1 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-20.9.1 spec/models/logistics/core/extended_lookup_spec.rb
logistics_core-20.8.1 spec/models/logistics/core/extended_lookup_spec.rb