Sha256: e82f738d9dfe2a2828efcc7fa0ed333d9ea96008439cd1b74167d7cf7c1955eb

Contents?: true

Size: 615 Bytes

Versions: 9

Compression:

Stored size: 615 Bytes

Contents

require 'rails_helper'

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

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

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

      it 'is invalid with duplicate code' do
        lookup = create(:payment_term)
        expect(build(:payment_term, :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/payment_term_spec.rb
logistics_core-21.11.1 spec/models/logistics/core/payment_term_spec.rb
logistics_core-21.08.1 spec/models/logistics/core/payment_term_spec.rb
logistics_core-21.03.1 spec/models/logistics/core/payment_term_spec.rb
logistics_core-20.10.3 spec/models/logistics/core/payment_term_spec.rb
logistics_core-20.10.2 spec/models/logistics/core/payment_term_spec.rb
logistics_core-20.10.1 spec/models/logistics/core/payment_term_spec.rb
logistics_core-20.9.1 spec/models/logistics/core/payment_term_spec.rb
logistics_core-20.8.1 spec/models/logistics/core/payment_term_spec.rb