summaryrefslogtreecommitdiff
path: root/features/steps/shared/diff_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/diff_note.rb
parent69bbc413fec7aa4168d9ff12df5421674db90032 (diff)
downloadgitlab-ce-584f8601eff79fe6e400026ba6db086002ce2cba.tar.gz
Change `within` to `page.within` in feature steps
Diffstat (limited to 'features/steps/shared/diff_note.rb')
-rw-r--r--features/steps/shared/diff_note.rb42
1 files changed, 21 insertions, 21 deletions
diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb
index 5b75e45e18a..a716ca5837c 100644
--- a/features/steps/shared/diff_note.rb
+++ b/features/steps/shared/diff_note.rb
@@ -3,7 +3,7 @@ module SharedDiffNote
include RepoHelpers
step 'I cancel the diff comment' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
find(".js-close-discussion-note-form").click
end
end
@@ -14,14 +14,14 @@ module SharedDiffNote
end
step 'I haven\'t written any diff comment text' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
fill_in "note[note]", with: ""
end
end
step 'I leave a diff comment like "Typo, please fix"' do
click_diff_line(sample_commit.line_code)
- within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
+ page.within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
fill_in "note[note]", with: "Typo, please fix"
find(".js-comment-button").trigger("click")
sleep 0.05
@@ -30,7 +30,7 @@ module SharedDiffNote
step 'I preview a diff comment text like "Should fix it :smile:"' do
click_diff_line(sample_commit.line_code)
- within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
+ page.within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
fill_in "note[note]", with: "Should fix it :smile:"
find('.js-md-preview-button').click
end
@@ -39,7 +39,7 @@ module SharedDiffNote
step 'I preview another diff comment text like "DRY this up"' do
click_diff_line(sample_commit.del_line_code)
- within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do
+ page.within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do
fill_in "note[note]", with: "DRY this up"
find('.js-md-preview-button').click
end
@@ -54,62 +54,62 @@ module SharedDiffNote
end
step 'I write a diff comment like ":-1: I don\'t like this"' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
fill_in "note[note]", with: ":-1: I don\'t like this"
end
end
step 'I submit the diff comment' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
click_button("Add Comment")
end
end
step 'I should not see the diff comment form' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).not_to have_css("form.new_note")
end
end
step 'The diff comment preview tab should say there is nothing to do' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) 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 diff comment text field' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(find('.js-note-text')).not_to be_visible
end
end
step 'I should only see one diff form' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_css("form.new_note", count: 1)
end
end
step 'I should see a diff comment form with ":-1: I don\'t like this"' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_field("note[note]", with: ":-1: I don\'t like this")
end
end
step 'I should see a diff comment saying "Typo, please fix"' do
- within("#{diff_file_selector} .note") do
+ page.within("#{diff_file_selector} .note") do
expect(page).to have_content("Typo, please fix")
end
end
step 'I should see a discussion reply button' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_button('Reply')
end
end
step 'I should see a temporary diff comment form' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_css(".js-temp-notes-holder form.new_note")
end
end
@@ -119,38 +119,38 @@ module SharedDiffNote
end
step 'I should see an empty diff comment form' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_field("note[note]", with: "")
end
end
step 'I should see the cancel comment button' do
- within("#{diff_file_selector} form") do
+ page.within("#{diff_file_selector} form") do
expect(page).to have_css(".js-close-discussion-note-form", text: "Cancel")
end
end
step 'I should see the diff comment preview' do
- within("#{diff_file_selector} form") do
+ page.within("#{diff_file_selector} form") do
expect(page).to have_css('.js-md-preview', visible: true)
end
end
step 'I should see the diff comment write tab' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_css('.js-md-write-button', visible: true)
end
end
step 'The diff comment preview tab should display rendered Markdown' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) 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 two separate previews' do
- within(diff_file_selector) do
+ page.within(diff_file_selector) do
expect(page).to have_css('.js-md-preview', visible: true, count: 2)
expect(page).to have_content('Should fix it')
expect(page).to have_content('DRY this up')