Commit f59196f6 authored by Ryan Cobb's avatar Ryan Cobb Committed by Ryan

Stub call to customers

parent 509ebc14
......@@ -56,15 +56,17 @@ RSpec.describe Subscriptions::CreateService do
context 'when successfully creating a customer' do
before do
allow(client).to receive(:create_customer).and_return(success: true, data: { success: true, 'customer' => { 'authentication_token' => 'token', 'email' => customer_email } })
end
it 'creates a subscription with the returned authentication token' do
expect(client)
allow(client)
.to receive(:create_subscription)
.with(anything, customer_email, 'token')
.and_return(success: true, data: { success: true, subscription_id: 'xxx' })
end
it 'creates a subscription with the returned authentication token' do
execute
expect(client).to have_received(:create_subscription).with(anything, customer_email, 'token')
end
it 'saves oauth token' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment