diff options
author | Jan <king-jan1999@hotmail.de> | 2018-06-13 10:23:57 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-13 10:23:57 +0000 |
commit | 1721bbcb013eed3c98c81d615087dd79dddb65be (patch) | |
tree | f9a882623d0a9369333f5ce5544303b7f934122e /spec/lib | |
parent | df2efbdbecb98111bfea23bec1bccfc975ec1328 (diff) | |
download | gitlab-ce-1721bbcb013eed3c98c81d615087dd79dddb65be.tar.gz |
Resolve "Quick actions are case sensitive"
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/quick_actions/extractor_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/quick_actions/extractor_spec.rb b/spec/lib/gitlab/quick_actions/extractor_spec.rb index f7c288f2393..0166f6c2ee0 100644 --- a/spec/lib/gitlab/quick_actions/extractor_spec.rb +++ b/spec/lib/gitlab/quick_actions/extractor_spec.rb @@ -182,6 +182,14 @@ describe Gitlab::QuickActions::Extractor do expect(msg).to eq "hello\nworld" end + it 'extracts command case insensitive' do + msg = %(hello\n/PoWer @user.name %9.10 ~"bar baz.2"\nworld) + msg, commands = extractor.extract_commands(msg) + + expect(commands).to eq [['power', '@user.name %9.10 ~"bar baz.2"']] + expect(msg).to eq "hello\nworld" + end + it 'does not extract noop commands' do msg = %(hello\nworld\n/reopen\n/noop_command) msg, commands = extractor.extract_commands(msg) @@ -206,6 +214,14 @@ describe Gitlab::QuickActions::Extractor do expect(msg).to eq "hello\nworld\nthis is great? SHRUG" end + it 'extracts and performs substitution commands case insensitive' do + msg = %(hello\nworld\n/reOpen\n/sHRuG this is great?) + msg, commands = extractor.extract_commands(msg) + + expect(commands).to eq [['reopen'], ['shrug', 'this is great?']] + expect(msg).to eq "hello\nworld\nthis is great? SHRUG" + end + it 'extracts and performs substitution commands with comments' do msg = %(hello\nworld\n/reopen\n/substitution wow this is a thing.) msg, commands = extractor.extract_commands(msg) |