Sha256: 04108ef85ac79a535bcc01b8dcdc764a4d87ba658bbffee3c92f57151711abef
Contents?: true
Size: 848 Bytes
Versions: 2
Compression:
Stored size: 848 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 { "months" } interval_count { 1 } livemode { false } stripe_product trait :with_stripe_mock do 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stripe_model_callbacks-0.1.2 | lib/stripe_model_callbacks/factories/stripe_plans.rb |
stripe_model_callbacks-0.1.1 | lib/stripe_model_callbacks/factories/stripe_plans.rb |