Add test for allowed team name of slack.
This commit is contained in:
parent
ee068e76f3
commit
cccfede34c
1 changed files with 20 additions and 0 deletions
|
@ -77,5 +77,25 @@ describe SlackService do
|
|||
WebMock.should have_requested(:post, api_url).once
|
||||
end
|
||||
end
|
||||
|
||||
context 'with new webhook syntax with slack allowed team name' do
|
||||
before do
|
||||
@allowed_webhook = 'https://gitlab-hq-123.slack.com/services/hooks/incoming-webhook?token=cdIj4r4LfXUOySDUjp0tk3OI'
|
||||
slack_service.stub(
|
||||
project: project,
|
||||
project_id: project.id,
|
||||
service_hook: true,
|
||||
webhook: @allowed_webhook
|
||||
)
|
||||
|
||||
WebMock.stub_request(:post, @allowed_webhook)
|
||||
end
|
||||
|
||||
it "should call Slack API" do
|
||||
slack_service.execute(sample_data)
|
||||
|
||||
WebMock.should have_requested(:post, @allowed_webhook).once
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue