diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 05:13:32 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 13:13:45 +0300 |
commit | afec5efc7dd0d0a063c30c3fff5ea5bbf59f9f48 (patch) | |
tree | 24a40ef59222c3c8e82eb8cbd4220e10e0c0e8d3 /features/steps/shared/diff_note.rb | |
parent | d6cd2e6a53aca48f76296cd6b89b0f2b41b641ed (diff) |
Fix features syntax
Diffstat (limited to 'features/steps/shared/diff_note.rb')
-rw-r--r-- | features/steps/shared/diff_note.rb | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index c4f89ca31c9..27a95aeb19a 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -20,11 +20,14 @@ module SharedDiffNote end step 'I leave a diff comment like "Typo, please fix"' do - click_diff_line(sample_commit.line_code) - 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 + page.within(diff_file_selector) do + click_diff_line(sample_commit.line_code) + + page.within("form[rel$='#{sample_commit.line_code}']") do + fill_in "note[note]", with: "Typo, please fix" + find(".js-comment-button").trigger("click") + sleep 0.05 + end end end @@ -45,28 +48,37 @@ module SharedDiffNote end step 'I preview a diff comment text like "Should fix it :smile:"' do - click_diff_line(sample_commit.line_code) - 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 + page.within(diff_file_selector) do + click_diff_line(sample_commit.line_code) + + page.within("form[rel$='#{sample_commit.line_code}']") do + fill_in "note[note]", with: "Should fix it :smile:" + find('.js-md-preview-button').click + end end end step 'I preview another diff comment text like "DRY this up"' do - click_diff_line(sample_commit.del_line_code) + page.within(diff_file_selector) do + click_diff_line(sample_commit.del_line_code) - 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 + page.within("form[rel$='#{sample_commit.del_line_code}']") do + fill_in "note[note]", with: "DRY this up" + find('.js-md-preview-button').click + end end end step 'I open a diff comment form' do - click_diff_line(sample_commit.line_code) + page.within(diff_file_selector) do + click_diff_line(sample_commit.line_code) + end end step 'I open another diff comment form' do - click_diff_line(sample_commit.del_line_code) + page.within(diff_file_selector) do + click_diff_line(sample_commit.del_line_code) + end end step 'I write a diff comment like ":-1: I don\'t like this"' do @@ -194,7 +206,7 @@ module SharedDiffNote end def diff_file_selector - ".diff-file:nth-of-type(1)" + '.diff-file:nth-of-type(1)' end def click_diff_line(code) |