These are chat archives for rebelidealist/stripe-ruby-mock

15th
Sep 2016
unknown
@s0c131y
Sep 15 2016 01:25
Hi I have a questions. I'm new to RSpec and How should I specify how many times mock is called with stripe mock? allow(Stripe::Plan).to receive(:create).and_return(stripe_plan_mock) this doesn't work.
unknown
@s0c131y
Sep 15 2016 01:30
 it "forces Stripe API call to be triggered once if the same plan already exists" do
   stripe_plan_mock = stripe_helper.create_plan(id: 'arukas_1',
                                                amount: 0,
                                                currency: 'jpy',
                                                name: 'arukas_default_montly_plan',
   )
   allow(Stripe::Plan).to receive(:create).and_return(stripe_plan_mock)

   CreatePlan.call()
   CreatePlan.call()

   expect(Stripe::Plan).to receive(:create).once
 end
This is the entire test block.