Sha256: 5c4228e4962f7bbfe256e9c965f460abb8c568fd19cc70d0cb70c7d407ea8f2d

Contents?: true

Size: 779 Bytes

Versions: 9

Compression:

Stored size: 779 Bytes

Contents

require 'rails_helper'

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

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

      it 'is invalid with no document type' do
        expect(build(:agency_permit_document, :document_type_id => nil)).not_to be_valid
      end

      it 'is invalid with duplicate agency and document type' do
        lookup = create(:agency_permit_document)
        expect(build(:agency_permit_document, :agency_id => lookup.agency_id, :document_type_id => lookup.document_type_id)).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/agency_permit_document_spec.rb
logistics_core-21.11.1 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-21.08.1 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-21.03.1 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-20.10.3 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-20.10.2 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-20.10.1 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-20.9.1 spec/models/logistics/core/agency_permit_document_spec.rb
logistics_core-20.8.1 spec/models/logistics/core/agency_permit_document_spec.rb