diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 18:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 18:09:00 +0300 |
commit | c282dba898a4cb0645f88579339502a4e3778727 (patch) | |
tree | 94a6457ce4438e085c9ae43bc51a2b5a29787bf2 /spec/lib/gitlab/quick_actions | |
parent | 2c2dd5e36c4ed5f09f488be288882d98f9124d12 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/quick_actions')
-rw-r--r-- | spec/lib/gitlab/quick_actions/extractor_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/quick_actions/extractor_spec.rb b/spec/lib/gitlab/quick_actions/extractor_spec.rb index f1acb5b7049..2536e4a372b 100644 --- a/spec/lib/gitlab/quick_actions/extractor_spec.rb +++ b/spec/lib/gitlab/quick_actions/extractor_spec.rb @@ -294,4 +294,22 @@ describe Gitlab::QuickActions::Extractor do expect(msg).to eq expected_msg end end + + describe '#redact_commands' do + using RSpec::Parameterized::TableSyntax + + where(:text, :expected) do + "hello\n/labels ~label1 ~label2\nworld" | "hello\n`/labels ~label1 ~label2`\nworld" + "hello\n/open\n/labels ~label1\nworld" | "hello\n`/open`\n`/labels ~label1`\nworld" + "hello\n/reopen\nworld" | "hello\n`/reopen`\nworld" + "/reopen\nworld" | "`/reopen`\nworld" + "hello\n/open" | "hello\n`/open`" + end + + with_them do + it 'encloses quick actions with code span markdown' do + expect(extractor.redact_commands(text)).to eq(expected) + end + end + end end |