summaryrefslogtreecommitdiff
path: root/features/steps/shared/note.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-12 01:36:00 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-12 05:12:42 -0400
commit584f8601eff79fe6e400026ba6db086002ce2cba (patch)
treeca092524666d4b7353d766512800b8992359ac2a /features/steps/shared/note.rb
parent69bbc413fec7aa4168d9ff12df5421674db90032 (diff)
downloadgitlab-ce-584f8601eff79fe6e400026ba6db086002ce2cba.tar.gz
Change `within` to `page.within` in feature steps
Diffstat (limited to 'features/steps/shared/note.rb')
-rw-r--r--features/steps/shared/note.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
index 59dca1db706..b2675546a14 100644
--- a/features/steps/shared/note.rb
+++ b/features/steps/shared/note.rb
@@ -7,13 +7,13 @@ module SharedNote
end
step 'I haven\'t written any comment text' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
fill_in "note[note]", with: ""
end
end
step 'I leave a comment like "XML attached"' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
fill_in "note[note]", with: "XML attached"
click_button "Add Comment"
sleep 0.05
@@ -21,20 +21,20 @@ module SharedNote
end
step 'I preview a comment text like "Bug fixed :smile:"' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
fill_in "note[note]", with: "Bug fixed :smile:"
find('.js-md-preview-button').click
end
end
step 'I submit the comment' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
click_button "Add Comment"
end
end
step 'I write a comment like ":+1: Nice"' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
fill_in 'note[note]', with: ':+1: Nice'
end
end
@@ -44,63 +44,63 @@ module SharedNote
end
step 'I should not see the cancel comment button' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
should_not have_link("Cancel")
end
end
step 'I should not see the comment preview' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
expect(find('.js-md-preview')).not_to be_visible
end
end
step 'The comment preview tab should say there is nothing to do' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-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 comment text field' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
expect(find('.js-note-text')).not_to be_visible
end
end
step 'I should see a comment saying "XML attached"' do
- within(".note") do
+ page.within(".note") do
expect(page).to have_content("XML attached")
end
end
step 'I should see an empty comment text field' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
expect(page).to have_field("note[note]", with: "")
end
end
step 'I should see the comment write tab' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
expect(page).to have_css('.js-md-write-button', visible: true)
end
end
step 'The comment preview tab should be display rendered Markdown' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
find('.js-md-preview-button').click
expect(find('.js-md-preview')).to have_css('img.emoji', visible: true)
end
end
step 'I should see the comment preview' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
expect(page).to have_css('.js-md-preview', visible: true)
end
end
step 'I should see comment "XML attached"' do
- within(".note") do
+ page.within(".note") do
expect(page).to have_content("XML attached")
end
end
@@ -108,7 +108,7 @@ module SharedNote
# Markdown
step 'I leave a comment with a header containing "Comment with a header"' do
- within(".js-main-target-form") do
+ page.within(".js-main-target-form") do
fill_in "note[note]", with: "# Comment with a header"
click_button "Add Comment"
sleep 0.05
@@ -116,7 +116,7 @@ module SharedNote
end
step 'The comment with the header should not have an ID' do
- within(".note-body > .note-text") do
+ page.within(".note-body > .note-text") do
expect(page).to have_content("Comment with a header")
expect(page).not_to have_css("#comment-with-a-header")
end
@@ -126,7 +126,7 @@ module SharedNote
find(".note").hover
find('.js-note-edit').click
- within(".current-note-edit-form") do
+ page.within(".current-note-edit-form") do
fill_in 'note[note]', with: '+1 Awesome!'
click_button 'Save Comment'
sleep 0.05
@@ -134,7 +134,7 @@ module SharedNote
end
step 'I should see +1 in the description' do
- within(".note") do
+ page.within(".note") do
expect(page).to have_content("+1 Awesome!")
end
end