Commit 6c8a17d06dc13bb8fa5944710ca148c2ccfe8557

Authored by Dmitriy Zaporozhets
1 parent 8290c9a6

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