summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-10-21 11:33:26 +0200
committerMarin Jankovski <maxlazio@gmail.com>2014-10-21 11:33:26 +0200
commitcccfede34cac854b4a6cbbe64d83647ee0c0af35 (patch)
tree117a1e70593d0976e2ea012ac6eafff67c8074ec /spec
parentee068e76f334040fee7f328c67832489dd0de51a (diff)
downloadgitlab-ce-cccfede34cac854b4a6cbbe64d83647ee0c0af35.tar.gz
Add test for allowed team name of slack.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/slack_service_spec.rb20
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