Sha256: 906f7802910bd80f6d01a32ede2ced4e23977f56bd5c5879e206078ca5d47ea9

Contents?: true

Size: 732 Bytes

Versions: 9

Compression:

Stored size: 732 Bytes

Contents

require 'rails_helper'

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

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

      it 'is invalid with no storage point' do
        expect(build(:esl_transport_tariff, :storage_point => nil)).not_to be_valid
      end

      it 'is invalid with duplicate route and storage point' do
        tt = create(:esl_transport_tariff)
        expect(build(:esl_transport_tariff, :route => tt.route, :storage_point => tt.storage_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/esl_transport_tariff_spec.rb
logistics_core-21.11.1 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-21.08.1 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-21.03.1 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-20.10.3 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-20.10.2 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-20.10.1 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-20.9.1 spec/models/logistics/core/esl_transport_tariff_spec.rb
logistics_core-20.8.1 spec/models/logistics/core/esl_transport_tariff_spec.rb