summaryrefslogtreecommitdiff
path: root/features/steps/shared/markdown.rb
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-10-15 02:21:21 -0500
committerVinnie Okada <vokada@mrvinn.com>2014-10-15 23:52:33 -0500
commit5700842ba8ca2f3100395a9fb98c759e78e63d96 (patch)
tree5014cffa098acd7f864159cdf2db1edcf1b21dd6 /features/steps/shared/markdown.rb
parenta0a826ebdcb783c660dd40d8cb217db28a9d4998 (diff)
downloadgitlab-ce-5700842ba8ca2f3100395a9fb98c759e78e63d96.tar.gz
Add Markdown preview to more forms
Enable Markdown previews when creating and editing issues, merge requests, and milestones, and when editing notes.
Diffstat (limited to 'features/steps/shared/markdown.rb')
-rw-r--r--features/steps/shared/markdown.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb
index 8bf138065b0..f3e61aa8e49 100644
--- a/features/steps/shared/markdown.rb
+++ b/features/steps/shared/markdown.rb
@@ -54,4 +54,43 @@ EOT
'div.description li.task-list-item input[type="checkbox"]:disabled'
)
end
+
+ step 'I should not see the Markdown preview' do
+ find('.gfm-form').should have_css('.js-md-preview', visible: false)
+ end
+
+ step 'I should not see the Markdown preview button' do
+ find('.gfm-form').should have_css('.js-md-preview-button', visible: false)
+ end
+
+ step 'I should not see the Markdown text field' do
+ find('.gfm-form').should have_css('textarea', visible: false)
+ end
+
+ step 'I should see the Markdown edit button' do
+ find('.gfm-form').should have_css('.js-md-write-button', visible: true)
+ end
+
+ step 'I should see the Markdown preview' do
+ find('.gfm-form').should have_css('.js-md-preview', visible: true)
+ end
+
+ step 'I should see the Markdown preview button' do
+ find('.gfm-form').should have_css('.js-md-preview-button', visible: true)
+ end
+
+ step 'I write a description like "Nice"' do
+ find('.gfm-form').fill_in 'Description', with: 'Nice'
+ end
+
+ step 'I preview a description text like "Bug fixed :smile:"' do
+ within('.gfm-form') do
+ fill_in 'Description', with: 'Bug fixed :smile:'
+ find('.js-md-preview-button').trigger('click')
+ end
+ end
+
+ step 'I haven\'t written any description text' do
+ find('.gfm-form').fill_in 'Description', with: ''
+ end
end