diff options
author | Jason Goodman <jgoodman@gitlab.com> | 2019-04-27 00:08:41 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-27 00:08:41 +0300 |
commit | fe86890b9d7a720648e7570d227c438d6ca7f25a (patch) | |
tree | 1c583b22cea6404de37ae6217f320d93cdf7cde9 /spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb | |
parent | 265b789476479c29ea88db174aca1d80ddf24358 (diff) |
Add deployment events to chat notification services
This enables sending a chat message to Slack or Mattermost
upon a successful, failed, or canceled deployment
Diffstat (limited to 'spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb b/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb index 940c24c8d67..c31346374f4 100644 --- a/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb +++ b/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb @@ -106,6 +106,14 @@ RSpec.shared_examples 'slack or mattermost notifications' do expect(WebMock).to have_requested(:post, webhook_url).once end + it "calls Slack/Mattermost API for deployment events" do + deployment_event_data = { object_kind: 'deployment' } + + chat_service.execute(deployment_event_data) + + expect(WebMock).to have_requested(:post, webhook_url).once + end + it 'uses the username as an option for slack when configured' do allow(chat_service).to receive(:username).and_return(username) |