gitlab-org--gitlab-foss/spec/models/hooks/service_hook_spec.rb

26 lines
586 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
2012-11-19 13:14:05 -05:00
RSpec.describe ServiceHook do
describe 'associations' do
it { is_expected.to belong_to :service }
2012-11-19 13:14:05 -05:00
end
2017-07-20 11:12:06 -04:00
describe 'validations' do
it { is_expected.to validate_presence_of(:service) }
end
describe 'execute' do
let(:hook) { build(:service_hook) }
let(:data) { { key: 'value' } }
it '#execute' do
expect(WebHookService).to receive(:new).with(hook, data, 'service_hook').and_call_original
expect_any_instance_of(WebHookService).to receive(:execute)
hook.execute(data)
end
end
2012-11-19 13:14:05 -05:00
end