Chatwoot/spec/lib/webhooks/trigger_spec.rb
2020-07-21 12:15:24 +05:30

15 lines
381 B
Ruby

require 'rails_helper'
describe Webhooks::Trigger do
subject(:trigger) { described_class }
describe '#execute' do
it 'triggers webhook' do
params = { hello: :hello }
url = 'https://test.com'
expect(RestClient).to receive(:post).with(url, params.to_json, { accept: :json, content_type: :json }).once
trigger.execute(url, params)
end
end
end