discourse-subscriptions/spec/requests/customers_controller_spec.rb

27 lines
611 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'rails_helper'
2019-12-03 19:23:45 -05:00
module DiscourseSubscriptions
RSpec.describe CustomersController do
describe "create" do
2019-10-25 20:31:19 -04:00
describe "authenticated" do
let(:user) { Fabricate(:user, email: 'hello.2@example.com') }
2019-10-25 20:31:19 -04:00
before do
sign_in(user)
end
it "creates a stripe customer" do
::Stripe::Customer.expects(:create).with(
email: 'hello.2@example.com',
source: 'tok_interesting'
)
2019-12-02 19:48:12 -05:00
post "/s/customers.json", params: { source: 'tok_interesting' }
2019-10-25 20:31:19 -04:00
end
end
end
end
end