Files
discourse-subscriptions/spec/requests/customers_controller_spec.rb
T

27 lines
611 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'rails_helper'
2019-12-04 11:23:45 +11:00
module DiscourseSubscriptions
RSpec.describe CustomersController do
describe "create" do
2019-10-26 11:31:19 +11:00
describe "authenticated" do
let(:user) { Fabricate(:user, email: '[email protected]') }
2019-10-26 11:31:19 +11:00
before do
sign_in(user)
end
2019-10-26 11:31:19 +11:00
it "creates a stripe customer" do
::Stripe::Customer.expects(:create).with(
email: '[email protected]',
source: 'tok_interesting'
)
2019-12-03 11:48:12 +11:00
post "/s/customers.json", params: { source: 'tok_interesting' }
2019-10-26 11:31:19 +11:00
end
end
end
end
end