Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chrisjwilson.com>2017-05-08 05:00:30 +0300
committerChris Wilson <chris@chrisjwilson.com>2017-05-08 08:55:02 +0300
commit52c8651a6caf5236ff173555164b676958540b9e (patch)
treea881b4466c0303f4b0d0e659041980452929b6c8 /spec/support/slack_mattermost_notifications_shared_examples.rb
parent8b9cd3c072768ca810d2b33009e35d93a05e417f (diff)
Fix notify_only_default_branch check for Slack service
The notify_only_default_branch property is using boolean_accessor this means we need to check it using a question methods. Also add specs for disabling this option.
Diffstat (limited to 'spec/support/slack_mattermost_notifications_shared_examples.rb')
-rw-r--r--spec/support/slack_mattermost_notifications_shared_examples.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/support/slack_mattermost_notifications_shared_examples.rb b/spec/support/slack_mattermost_notifications_shared_examples.rb
index b902fe90707..7e35ebb6c97 100644
--- a/spec/support/slack_mattermost_notifications_shared_examples.rb
+++ b/spec/support/slack_mattermost_notifications_shared_examples.rb
@@ -328,7 +328,7 @@ RSpec.shared_examples 'slack or mattermost notifications' do
context 'only notify for the default branch' do
context 'when enabled' do
let(:pipeline) do
- create(:ci_pipeline, project: project, status: 'failed', ref: 'not-the-default-branch')
+ create(:ci_pipeline, :failed, project: project, ref: 'not-the-default-branch')
end
before do
@@ -342,6 +342,18 @@ RSpec.shared_examples 'slack or mattermost notifications' do
expect(result).to be_falsy
end
end
+
+ context 'when disabled' do
+ let(:pipeline) do
+ create(:ci_pipeline, :failed, project: project, ref: 'not-the-default-branch')
+ end
+
+ before do
+ chat_service.notify_only_default_branch = false
+ end
+
+ it_behaves_like 'call Slack/Mattermost API'
+ end
end
end
end