From ea090291bba6bb665b3631cc5a2659e6673a6959 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 31 May 2017 00:50:53 -0500 Subject: Rename "Slash commands" to "Quick actions" Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27070 Deprecate "chat commands" in favor of "slash commands" We looked for things like: - `slash commmand` - `slash_command` - `slash-command` - `SlashCommand` --- spec/support/chat_slash_commands_shared_examples.rb | 2 +- .../features/issuable_slash_commands_shared_examples.rb | 6 +++--- spec/support/quick_actions_helpers.rb | 10 ++++++++++ .../issuable_create_service_slash_commands_shared_examples.rb | 2 +- spec/support/slash_commands_helpers.rb | 10 ---------- spec/support/time_tracking_shared_examples.rb | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 spec/support/quick_actions_helpers.rb delete mode 100644 spec/support/slash_commands_helpers.rb (limited to 'spec/support') diff --git a/spec/support/chat_slash_commands_shared_examples.rb b/spec/support/chat_slash_commands_shared_examples.rb index 4dfa29849ee..978b0b9cc30 100644 --- a/spec/support/chat_slash_commands_shared_examples.rb +++ b/spec/support/chat_slash_commands_shared_examples.rb @@ -87,7 +87,7 @@ RSpec.shared_examples 'chat slash commands service' do end it 'triggers the command' do - expect_any_instance_of(Gitlab::ChatCommands::Command).to receive(:execute) + expect_any_instance_of(Gitlab::SlashCommands::Command).to receive(:execute) subject.trigger(params) end diff --git a/spec/support/features/issuable_slash_commands_shared_examples.rb b/spec/support/features/issuable_slash_commands_shared_examples.rb index fa82dc5e9f9..db39e8dfd89 100644 --- a/spec/support/features/issuable_slash_commands_shared_examples.rb +++ b/spec/support/features/issuable_slash_commands_shared_examples.rb @@ -1,8 +1,8 @@ # Specifications for behavior common to all objects with executable attributes. # It takes a `issuable_type`, and expect an `issuable`. -shared_examples 'issuable record that supports slash commands in its description and notes' do |issuable_type| - include SlashCommandsHelpers +shared_examples 'issuable record that supports quick actions in its description and notes' do |issuable_type| + include QuickActionsHelpers let(:master) { create(:user) } let(:assignee) { create(:user, username: 'bob') } @@ -260,7 +260,7 @@ shared_examples 'issuable record that supports slash commands in its description end describe "preview of note on #{issuable_type}" do - it 'removes slash commands from note and explains them' do + it 'removes quick actions from note and explains them' do visit public_send("namespace_project_#{issuable_type}_path", project.namespace, project, issuable) page.within('.js-main-target-form') do diff --git a/spec/support/quick_actions_helpers.rb b/spec/support/quick_actions_helpers.rb new file mode 100644 index 00000000000..d2aaae7518f --- /dev/null +++ b/spec/support/quick_actions_helpers.rb @@ -0,0 +1,10 @@ +module QuickActionsHelpers + def write_note(text) + Sidekiq::Testing.fake! do + page.within('.js-main-target-form') do + fill_in 'note[note]', with: text + find('.js-comment-submit-button').trigger('click') + end + end + end +end diff --git a/spec/support/services/issuable_create_service_slash_commands_shared_examples.rb b/spec/support/services/issuable_create_service_slash_commands_shared_examples.rb index 5e6f9f323a1..9399745f900 100644 --- a/spec/support/services/issuable_create_service_slash_commands_shared_examples.rb +++ b/spec/support/services/issuable_create_service_slash_commands_shared_examples.rb @@ -1,7 +1,7 @@ # Specifications for behavior common to all objects with executable attributes. # It can take a `default_params`. -shared_examples 'new issuable record that supports slash commands' do +shared_examples 'new issuable record that supports quick actions' do let!(:project) { create(:project, :repository) } let(:user) { create(:user).tap { |u| project.team << [u, :master] } } let(:assignee) { create(:user) } diff --git a/spec/support/slash_commands_helpers.rb b/spec/support/slash_commands_helpers.rb deleted file mode 100644 index 4bfe481115f..00000000000 --- a/spec/support/slash_commands_helpers.rb +++ /dev/null @@ -1,10 +0,0 @@ -module SlashCommandsHelpers - def write_note(text) - Sidekiq::Testing.fake! do - page.within('.js-main-target-form') do - fill_in 'note[note]', with: text - find('.js-comment-submit-button').trigger('click') - end - end - end -end diff --git a/spec/support/time_tracking_shared_examples.rb b/spec/support/time_tracking_shared_examples.rb index b407b8097d2..0fa74f911f6 100644 --- a/spec/support/time_tracking_shared_examples.rb +++ b/spec/support/time_tracking_shared_examples.rb @@ -54,7 +54,7 @@ shared_examples 'issuable time tracker' do it 'shows the help state when icon is clicked' do page.within '.time-tracking-component-wrap' do find('.help-button').click - expect(page).to have_content 'Track time with slash commands' + expect(page).to have_content 'Track time with quick actions' expect(page).to have_content 'Learn more' end end @@ -64,7 +64,7 @@ shared_examples 'issuable time tracker' do find('.help-button').click find('.close-help-button').click - expect(page).not_to have_content 'Track time with slash commands' + expect(page).not_to have_content 'Track time with quick actions' expect(page).not_to have_content 'Learn more' end end @@ -78,8 +78,8 @@ shared_examples 'issuable time tracker' do end end -def submit_time(slash_command) - fill_in 'note[note]', with: slash_command +def submit_time(quick_action) + fill_in 'note[note]', with: quick_action find('.js-comment-submit-button').trigger('click') wait_for_requests end -- cgit v1.2.3