Skip to content

Commit

Permalink
Add test for allowed team name of slack.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlazio authored and vsizov committed Oct 21, 2014
1 parent 9f54397 commit 536f61e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/models/slack_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,25 @@
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

0 comments on commit 536f61e

Please sign in to comment.