diff options
author | Rares Sfirlogea <rrr.junior@gmail.com> | 2016-11-16 12:09:09 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-05-04 17:02:25 +0200 |
commit | 45e4c665653cd511b0d96119d3973652c43238bb (patch) | |
tree | b614bb895b59dfb2f27d1408d0ed7594c4182c73 /spec/support | |
parent | 2d43f8a2f4b1352067755609c9e3110d382d06c6 (diff) | |
download | gitlab-ce-adam-separate-slash-commands.tar.gz |
Display slash commands outcome when previewing Markdownadam-separate-slash-commands
Remove slash commands from Markdown preview and display their outcome next to
the text field.
Introduce new "explanation" block to our slash commands DSL.
Introduce optional "parse_params" block to slash commands DSL that allows to
process a parameter before it is passed to "explanation" or "command" blocks.
Pass path for previewing Markdown as "data" attribute instead of setting
a variable on "window".
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/features/issuable_slash_commands_shared_examples.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/features/issuable_slash_commands_shared_examples.rb b/spec/support/features/issuable_slash_commands_shared_examples.rb index 5bbe36d9b7f..6efcdd7a1de 100644 --- a/spec/support/features/issuable_slash_commands_shared_examples.rb +++ b/spec/support/features/issuable_slash_commands_shared_examples.rb @@ -257,4 +257,19 @@ shared_examples 'issuable record that supports slash commands in its description end end end + + describe "preview of note on #{issuable_type}" do + it 'removes slash commands 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 + fill_in 'note[note]', with: "Awesome!\n/assign @bob " + click_on 'Preview' + + expect(page).to have_content 'Awesome!' + expect(page).not_to have_content '/assign @bob' + expect(page).to have_content 'Assigns @bob.' + end + end + end end |