Files
discourse-subscriptions/spec/requests/hooks_controller_spec.rb
T
2020-01-13 11:10:06 +11:00

23 lines
482 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
module DiscourseSubscriptions
RSpec.describe HooksController do
it "contructs a webhook event" do
::Stripe::Webhook
.expects(:construct_event)
.with({}, 'stripe-webhook-signature', 'endpoint_secret')
.returns(true)
headers = {
'HTTP_STRIPE_SIGNATURE' => 'stripe-webhook-signature'
}
post "/s/hooks.json"
expect(response.status).to eq 200
end
end
end