Sha256: 6735f3223e64f7bd9a9afd877f74475b3aeb8b3ec7e9f89cf746b7e6c5c1c2db

Contents?: true

Size: 840 Bytes

Versions: 157

Compression:

Stored size: 840 Bytes

Contents

FactoryBot.define do
  factory :client_price, class: "Comee::Core::ClientPrice" do
    valid_from { Date.current.advance(months: -1) }
    valid_to { Date.current.advance(months: 1) }
    price_status { Comee::Core::Price.price_statuses[:draft] }
    price { 100 }
    product
    client
    unit
    margin { 0.0 }
    margin_type { Comee::Core::ClientPrice.margin_types[:increase] }
    previous_price { nil }
    next_price { nil }
    product_lookup { nil }

    trait :past do
      valid_from { Date.current.advance(months: -2) }
      valid_to { Date.current.advance(months: -1) }
    end

    trait :future do
      valid_from { Date.current.advance(months: 1) }
      valid_to { Date.current.advance(months: 2) }
    end

    trait :approved do
      price_status { Comee::Core::Price.price_statuses[:approved] }
    end
  end
end

Version data entries

157 entries across 157 versions & 1 rubygems

Version Path
comee_core-0.2.16 spec/factories/comee/core/client_prices.rb
comee_core-0.2.15 spec/factories/comee/core/client_prices.rb
comee_core-0.2.14 spec/factories/comee/core/client_prices.rb
comee_core-0.2.13 spec/factories/comee/core/client_prices.rb
comee_core-0.2.12 spec/factories/comee/core/client_prices.rb
comee_core-0.2.11 spec/factories/comee/core/client_prices.rb
comee_core-0.2.10 spec/factories/comee/core/client_prices.rb
comee_core-0.2.9 spec/factories/comee/core/client_prices.rb
comee_core-0.2.8 spec/factories/comee/core/client_prices.rb
comee_core-0.2.7 spec/factories/comee/core/client_prices.rb
comee_core-0.2.6 spec/factories/comee/core/client_prices.rb
comee_core-0.2.5 spec/factories/comee/core/client_prices.rb
comee_core-0.2.4 spec/factories/comee/core/client_prices.rb
comee_core-0.2.3 spec/factories/comee/core/client_prices.rb
comee_core-0.2.2 spec/factories/comee/core/client_prices.rb
comee_core-0.2.1 spec/factories/comee/core/client_prices.rb
comee_core-0.2.0 spec/factories/comee/core/client_prices.rb