Sha256: cfabb65f65b9783fb6d2d4a728b1ef88c89c8f58e430c3f3340cfa789ec33e1e
Contents?: true
Size: 929 Bytes
Versions: 3
Compression:
Stored size: 929 Bytes
Contents
FactoryBot.define do factory :stripe_plan do sequence(:stripe_id) { |n| "stripe_plan_#{n}" } amount_cents { 10_000 } amount_currency { "USD" } currency { "usd" } interval { "month" } interval_count { 1 } livemode { false } stripe_product trait :with_stripe_mock do association :stripe_product, factory: [:stripe_product, :with_stripe_mock] after :create do |stripe_plan| mock_plan = Stripe::Plan.create( id: stripe_plan.stripe_id, amount: stripe_plan.amount_cents, currency: stripe_plan.currency, name: "No name any more - waiting for Stripe mock to be updated", interval: stripe_plan.interval, interval_count: stripe_plan.interval_count, product: stripe_plan.stripe_product.stripe_id ) stripe_plan.assign_from_stripe(mock_plan) stripe_plan.save! end end end end
Version data entries
3 entries across 3 versions & 1 rubygems