Welcome to mirror list, hosted at ThFree Co, Russian Federation.

service_hook_spec.rb « hooks « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e32eaafc13f07948b66ca0c29388ca30644fa2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe ServiceHook do
  describe 'associations' do
    it { is_expected.to belong_to :service }
  end

  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
end