Sha256: 6c48985d2b6beef3ec779d6d0fb13cd3034b6fa149d2ef4ecba8daa6a82898f0

Contents?: true

Size: 1.17 KB

Versions: 9

Compression:

Stored size: 1.17 KB

Contents

require 'rails_helper'

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

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

      it 'is invalid with no entry point' do
        expect(build(:customs_transport_tariff, :entry_point => nil)).not_to be_valid
      end

      it 'is invalid with no total distance' do
        expect(build(:customs_transport_tariff, :total_distance => nil)).not_to be_valid
      end

      it 'is invalid with no distance to entry point' do
        expect(build(:customs_transport_tariff, :distance_to_entry_point => nil)).not_to be_valid
      end

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

      it 'is invalid with duplicate route and entry point' do
        ctt = create(:customs_transport_tariff)
        expect(build(:customs_transport_tariff, :route => ctt.route, :entry_point => ctt.entry_point)).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/customs_transport_tariff_spec.rb
logistics_core-21.11.1 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-21.08.1 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-21.03.1 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-20.10.3 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-20.10.2 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-20.10.1 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-20.9.1 spec/models/logistics/core/customs_transport_tariff_spec.rb
logistics_core-20.8.1 spec/models/logistics/core/customs_transport_tariff_spec.rb