diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 15:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 15:08:49 +0300 |
commit | 1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (patch) | |
tree | 614a93d9bf8df34ecfc25c02648329987fb21dde /spec/lib/gitlab/quick_actions | |
parent | f0707f413ce49b5712fca236b950acbec029be1e (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/substitution_definition_spec.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb b/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb index d0bb032f776..a09aca31cdc 100644 --- a/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb +++ b/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb @@ -19,11 +19,29 @@ EOF expect(subject.perform_substitution(self, nil)).to be_nil end - it 'performs the substitution by default' do - expect(subject.perform_substitution(self, content)).to eq <<EOF + context 'when content contains command name' do + it 'performs the substitution by default' do + expect(subject.perform_substitution(self, content)).to eq <<EOF Hello! Let's do this! I like this stuff foo EOF + end + end + + context 'when content contains command name in word' do + let(:content) do + <<EOF +Hello! Let's do this! +`/sub_names` I like this stuff +EOF + end + + it 'does not perform the substitution' do + expect(subject.perform_substitution(self, content)).to eq <<EOF +Hello! Let's do this! +`/sub_names` I like this stuff +EOF + end end end @@ -41,5 +59,9 @@ EOF it 'is nil if content does not have the command' do expect(subject.match('blah')).to be_falsey end + + it 'is nil if content contains the command as prefix' do + expect(subject.match('/sub_namex')).to be_falsey + end end end |