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:
Diffstat (limited to 'spec/lib/gitlab/slash_commands/application_help_spec.rb')
-rw-r--r--spec/lib/gitlab/slash_commands/application_help_spec.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/lib/gitlab/slash_commands/application_help_spec.rb b/spec/lib/gitlab/slash_commands/application_help_spec.rb
index b82121bf3a8..b182c0e5cc6 100644
--- a/spec/lib/gitlab/slash_commands/application_help_spec.rb
+++ b/spec/lib/gitlab/slash_commands/application_help_spec.rb
@@ -4,11 +4,13 @@ require 'spec_helper'
RSpec.describe Gitlab::SlashCommands::ApplicationHelp do
let(:params) { { command: '/gitlab', text: 'help' } }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:chat_user) { create(:chat_name, user: user) }
let(:project) { build(:project) }
describe '#execute' do
subject do
- described_class.new(project, params).execute
+ described_class.new(project, chat_user, params).execute
end
it 'displays the help section' do
@@ -16,5 +18,23 @@ RSpec.describe Gitlab::SlashCommands::ApplicationHelp do
expect(subject[:text]).to include('Available commands')
expect(subject[:text]).to include('/gitlab [project name or alias] issue show')
end
+
+ context 'with incident declare command' do
+ context 'when feature flag is enabled' do
+ it 'displays the declare command' do
+ expect(subject[:text]).to include('/gitlab incident declare')
+ end
+ end
+
+ context 'when feature flag is disabled' do
+ before do
+ stub_feature_flags(incident_declare_slash_command: false)
+ end
+
+ it 'does not displays the declare command' do
+ expect(subject[:text]).not_to include('/gitlab incident declare')
+ end
+ end
+ end
end
end