2020-02-14 17:49:17 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe Webhooks::Trigger do
|
|
|
|
subject(:trigger) { described_class }
|
|
|
|
|
|
|
|
describe '#execute' do
|
|
|
|
it 'triggers webhook' do
|
2020-07-21 06:45:24 +00:00
|
|
|
params = { hello: :hello }
|
|
|
|
url = 'https://test.com'
|
2020-02-14 17:49:17 +00:00
|
|
|
|
2020-07-21 06:45:24 +00:00
|
|
|
expect(RestClient).to receive(:post).with(url, params.to_json, { accept: :json, content_type: :json }).once
|
2020-02-14 17:49:17 +00:00
|
|
|
trigger.execute(url, params)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|