diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2014-10-16 23:36:52 -0500 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2014-10-18 18:07:23 -0500 |
commit | e06f0ead9843df2688ca2f341a3b37d4d56a955d (patch) | |
tree | f6ccee3ab1023f5be90d7931ee0c5504a9b2abd5 /features/steps/shared/markdown.rb | |
parent | e1491465de441b386c72726f0b869104d1c15680 (diff) | |
download | gitlab-ce-e06f0ead9843df2688ca2f341a3b37d4d56a955d.tar.gz |
Fix Markdown preview tests
Update Spinach tests for Markdown previews for the new-ish tab UI that
replaced the old preview/edit toggle button.
Diffstat (limited to 'features/steps/shared/markdown.rb')
-rw-r--r-- | features/steps/shared/markdown.rb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index df4514b5646..10da67a6ba8 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -56,18 +56,21 @@ EOT end step 'I should not see the Markdown preview' do - expect(find('.gfm-form')).not_to have_css('.js-md-preview') + expect(find('.gfm-form')).not_to have_css('.js-md-preview', visible: true) end - step 'I should not see the Markdown preview button' do - expect(find('.gfm-form')).not_to have_css('.js-md-preview-button') + step 'The Markdown preview tab should say there is nothing to do' do + within(".gfm-form") do + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_content('Nothing to preview.') + end end step 'I should not see the Markdown text field' do - expect(find('.gfm-form')).not_to have_css('textarea') + expect(find('.gfm-form')).not_to have_css('textarea', visible: true) end - step 'I should see the Markdown edit button' do + step 'I should see the Markdown write tab' do expect(find('.gfm-form')).to have_css('.js-md-write-button') end @@ -75,12 +78,15 @@ EOT expect(find('.gfm-form')).to have_css('.js-md-preview') end - step 'I should see the Markdown preview button' do - expect(find('.gfm-form')).to have_css('.js-md-preview-button') + step 'The Markdown preview tab should display rendered Markdown' do + within(".gfm-form") do + find('.js-md-preview-button').click + expect(find('.js-md-preview')).to have_css('img.emoji') + end end - step 'I write a description like "Nice"' do - find('.gfm-form').fill_in 'Description', with: 'Nice' + step 'I write a description like ":+1: Nice"' do + find('.gfm-form').fill_in 'Description', with: ':+1: Nice' end step 'I preview a description text like "Bug fixed :smile:"' do |