diff options
-rw-r--r-- | spec/models/slack_service_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/slack_service_spec.rb b/spec/models/slack_service_spec.rb index 95df38d9400..526165e397c 100644 --- a/spec/models/slack_service_spec.rb +++ b/spec/models/slack_service_spec.rb @@ -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 |