Commit 6c8a17d06dc13bb8fa5944710ca148c2ccfe8557
1 parent
8290c9a6
Exists in
spb-stable
and in
3 other branches
Fix diff tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
21 additions
and
21 deletions
Show diff stats
features/steps/shared/diff_note.rb
| ... | ... | @@ -2,7 +2,7 @@ module SharedDiffNote |
| 2 | 2 | include Spinach::DSL |
| 3 | 3 | |
| 4 | 4 | Given 'I cancel the diff comment' do |
| 5 | - within(".file") do | |
| 5 | + within(".diff-file") do | |
| 6 | 6 | find(".js-close-discussion-note-form").click |
| 7 | 7 | end |
| 8 | 8 | end |
| ... | ... | @@ -13,14 +13,14 @@ module SharedDiffNote |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | Given 'I haven\'t written any diff comment text' do |
| 16 | - within(".file") do | |
| 16 | + within(".diff-file") do | |
| 17 | 17 | fill_in "note[note]", with: "" |
| 18 | 18 | end |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | Given 'I leave a diff comment like "Typo, please fix"' do |
| 22 | 22 | find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click |
| 23 | - within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do | |
| 23 | + within(".diff-file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do | |
| 24 | 24 | fill_in "note[note]", with: "Typo, please fix" |
| 25 | 25 | find(".js-comment-button").trigger("click") |
| 26 | 26 | sleep 0.05 |
| ... | ... | @@ -29,7 +29,7 @@ module SharedDiffNote |
| 29 | 29 | |
| 30 | 30 | Given 'I preview a diff comment text like "Should fix it :smile:"' do |
| 31 | 31 | find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click |
| 32 | - within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do | |
| 32 | + within(".diff-file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do | |
| 33 | 33 | fill_in "note[note]", with: "Should fix it :smile:" |
| 34 | 34 | find(".js-note-preview-button").trigger("click") |
| 35 | 35 | end |
| ... | ... | @@ -38,7 +38,7 @@ module SharedDiffNote |
| 38 | 38 | Given 'I preview another diff comment text like "DRY this up"' do |
| 39 | 39 | find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_57_41"]').click |
| 40 | 40 | |
| 41 | - within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_57_41']") do | |
| 41 | + within(".diff-file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_57_41']") do | |
| 42 | 42 | fill_in "note[note]", with: "DRY this up" |
| 43 | 43 | find(".js-note-preview-button").trigger("click") |
| 44 | 44 | end |
| ... | ... | @@ -53,13 +53,13 @@ module SharedDiffNote |
| 53 | 53 | end |
| 54 | 54 | |
| 55 | 55 | Given 'I write a diff comment like ":-1: I don\'t like this"' do |
| 56 | - within(".file") do | |
| 56 | + within(".diff-file") do | |
| 57 | 57 | fill_in "note[note]", with: ":-1: I don\'t like this" |
| 58 | 58 | end |
| 59 | 59 | end |
| 60 | 60 | |
| 61 | 61 | Given 'I submit the diff comment' do |
| 62 | - within(".file") do | |
| 62 | + within(".diff-file") do | |
| 63 | 63 | click_button("Add Comment") |
| 64 | 64 | end |
| 65 | 65 | end |
| ... | ... | @@ -67,49 +67,49 @@ module SharedDiffNote |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | Then 'I should not see the diff comment form' do |
| 70 | - within(".file") do | |
| 70 | + within(".diff-file") do | |
| 71 | 71 | page.should_not have_css("form.new_note") |
| 72 | 72 | end |
| 73 | 73 | end |
| 74 | 74 | |
| 75 | 75 | Then 'I should not see the diff comment preview button' do |
| 76 | - within(".file") do | |
| 76 | + within(".diff-file") do | |
| 77 | 77 | page.should have_css(".js-note-preview-button", visible: false) |
| 78 | 78 | end |
| 79 | 79 | end |
| 80 | 80 | |
| 81 | 81 | Then 'I should not see the diff comment text field' do |
| 82 | - within(".file") do | |
| 82 | + within(".diff-file") do | |
| 83 | 83 | page.should have_css(".js-note-text", visible: false) |
| 84 | 84 | end |
| 85 | 85 | end |
| 86 | 86 | |
| 87 | 87 | Then 'I should only see one diff form' do |
| 88 | - within(".file") do | |
| 88 | + within(".diff-file") do | |
| 89 | 89 | page.should have_css("form.new_note", count: 1) |
| 90 | 90 | end |
| 91 | 91 | end |
| 92 | 92 | |
| 93 | 93 | Then 'I should see a diff comment form with ":-1: I don\'t like this"' do |
| 94 | - within(".file") do | |
| 94 | + within(".diff-file") do | |
| 95 | 95 | page.should have_field("note[note]", with: ":-1: I don\'t like this") |
| 96 | 96 | end |
| 97 | 97 | end |
| 98 | 98 | |
| 99 | 99 | Then 'I should see a diff comment saying "Typo, please fix"' do |
| 100 | - within(".file .note") do | |
| 100 | + within(".diff-file .note") do | |
| 101 | 101 | page.should have_content("Typo, please fix") |
| 102 | 102 | end |
| 103 | 103 | end |
| 104 | 104 | |
| 105 | 105 | Then 'I should see a discussion reply button' do |
| 106 | - within(".file") do | |
| 106 | + within(".diff-file") do | |
| 107 | 107 | page.should have_link("Reply") |
| 108 | 108 | end |
| 109 | 109 | end |
| 110 | 110 | |
| 111 | 111 | Then 'I should see a temporary diff comment form' do |
| 112 | - within(".file") do | |
| 112 | + within(".diff-file") do | |
| 113 | 113 | page.should have_css(".js-temp-notes-holder form.new_note") |
| 114 | 114 | end |
| 115 | 115 | end |
| ... | ... | @@ -119,37 +119,37 @@ module SharedDiffNote |
| 119 | 119 | end |
| 120 | 120 | |
| 121 | 121 | Then 'I should see an empty diff comment form' do |
| 122 | - within(".file") do | |
| 122 | + within(".diff-file") do | |
| 123 | 123 | page.should have_field("note[note]", with: "") |
| 124 | 124 | end |
| 125 | 125 | end |
| 126 | 126 | |
| 127 | 127 | Then 'I should see the cancel comment button' do |
| 128 | - within(".file form") do | |
| 128 | + within(".diff-file form") do | |
| 129 | 129 | page.should have_css(".js-close-discussion-note-form", text: "Cancel") |
| 130 | 130 | end |
| 131 | 131 | end |
| 132 | 132 | |
| 133 | 133 | Then 'I should see the diff comment preview' do |
| 134 | - within(".file form") do | |
| 134 | + within(".diff-file form") do | |
| 135 | 135 | page.should have_css(".js-note-preview", visible: false) |
| 136 | 136 | end |
| 137 | 137 | end |
| 138 | 138 | |
| 139 | 139 | Then 'I should see the diff comment edit button' do |
| 140 | - within(".file") do | |
| 140 | + within(".diff-file") do | |
| 141 | 141 | page.should have_css(".js-note-edit-button", visible: true) |
| 142 | 142 | end |
| 143 | 143 | end |
| 144 | 144 | |
| 145 | 145 | Then 'I should see the diff comment preview button' do |
| 146 | - within(".file") do | |
| 146 | + within(".diff-file") do | |
| 147 | 147 | page.should have_css(".js-note-preview-button", visible: true) |
| 148 | 148 | end |
| 149 | 149 | end |
| 150 | 150 | |
| 151 | 151 | Then 'I should see two separate previews' do |
| 152 | - within(".file") do | |
| 152 | + within(".diff-file") do | |
| 153 | 153 | page.should have_css(".js-note-preview", visible: true, count: 2) |
| 154 | 154 | page.should have_content("Should fix it") |
| 155 | 155 | page.should have_content("DRY this up") | ... | ... |