summaryrefslogtreecommitdiff
path: root/features/steps/shared/markdown.rb
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-10-16 23:10:50 -0500
committerVinnie Okada <vokada@mrvinn.com>2014-10-18 17:58:34 -0500
commite1491465de441b386c72726f0b869104d1c15680 (patch)
tree9207fdd5957bda3d22946e268054f19ad8c1f093 /features/steps/shared/markdown.rb
parentcd3eabd71236d2be1430d2dbf23aad91d73aa783 (diff)
downloadgitlab-ce-e1491465de441b386c72726f0b869104d1c15680.tar.gz
Refactor Markdown preview tests
Create a new shared module for common issue/merge request behavior, use `expect` syntax instead of `should`, and avoid `visible: false` in the `have_css` matcher.
Diffstat (limited to 'features/steps/shared/markdown.rb')
-rw-r--r--features/steps/shared/markdown.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb
index f3e61aa8e49..df4514b5646 100644
--- a/features/steps/shared/markdown.rb
+++ b/features/steps/shared/markdown.rb
@@ -56,27 +56,27 @@ EOT
end
step 'I should not see the Markdown preview' do
- find('.gfm-form').should have_css('.js-md-preview', visible: false)
+ expect(find('.gfm-form')).not_to have_css('.js-md-preview')
end
step 'I should not see the Markdown preview button' do
- find('.gfm-form').should have_css('.js-md-preview-button', visible: false)
+ expect(find('.gfm-form')).not_to have_css('.js-md-preview-button')
end
step 'I should not see the Markdown text field' do
- find('.gfm-form').should have_css('textarea', visible: false)
+ expect(find('.gfm-form')).not_to have_css('textarea')
end
step 'I should see the Markdown edit button' do
- find('.gfm-form').should have_css('.js-md-write-button', visible: true)
+ expect(find('.gfm-form')).to have_css('.js-md-write-button')
end
step 'I should see the Markdown preview' do
- find('.gfm-form').should have_css('.js-md-preview', visible: true)
+ expect(find('.gfm-form')).to have_css('.js-md-preview')
end
step 'I should see the Markdown preview button' do
- find('.gfm-form').should have_css('.js-md-preview-button', visible: true)
+ expect(find('.gfm-form')).to have_css('.js-md-preview-button')
end
step 'I write a description like "Nice"' do
@@ -86,7 +86,7 @@ EOT
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')
+ find('.js-md-preview-button').click()
end
end