Sha256: 57eaa4d44b42754efb16ed3ff2a2c22b456b602ddf577e719459f1276aa655c5

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

require 'rails_helper'

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

      it 'is invalid with no esl transport tariff' do
        expect(build(:esl_transport_tariff_rate, :esl_transport_tariff => nil)).not_to be_valid
      end

      it 'is invalid with no qt from' do
        expect(build(:esl_transport_tariff_rate, :qt_from => nil)).not_to be_valid
      end

      it 'is invalid with no qt to' do
        expect(build(:esl_transport_tariff_rate, :qt_to => nil)).not_to be_valid
      end

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

      it 'is invalid with duplicate transport tariff, qt from and qt to' do
        ttr = create(:esl_transport_tariff_rate)
        expect(build(:esl_transport_tariff_rate, :esl_transport_tariff => ttr.esl_transport_tariff,
                     :qt_from => ttr.qt_from, :qt_to => ttr.qt_to)).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/esl_transport_tariff_rate_spec.rb
logistics_core-21.11.1 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-21.08.1 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-21.03.1 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-20.10.3 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-20.10.2 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-20.10.1 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-20.9.1 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb
logistics_core-20.8.1 spec/models/logistics/core/esl_transport_tariff_rate_spec.rb