Commit 9db8cb3fecca819c2d48fbff9ad69d969a336801

Authored by Dmitriy Zaporozhets
1 parent 418660b9

fix tests notes_on_merge_requests

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 8 additions and 17 deletions   Show diff stats
spec/features/notes_on_merge_requests_spec.rb
@@ -135,7 +135,7 @@ describe &quot;On a merge request&quot;, js: true do @@ -135,7 +135,7 @@ describe &quot;On a merge request&quot;, js: true do
135 end 135 end
136 136
137 describe "On a merge request diff", js: true, focus: true do 137 describe "On a merge request diff", js: true, focus: true do
138 - let!(:project) { create(:source_project) } 138 + let!(:project) { create(:project) }
139 let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) } 139 let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) }
140 140
141 before do 141 before do
@@ -149,7 +149,7 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do @@ -149,7 +149,7 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
149 149
150 describe "when adding a note" do 150 describe "when adding a note" do
151 before do 151 before do
152 - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click 152 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
153 end 153 end
154 154
155 describe "the notes holder" do 155 describe "the notes holder" do
@@ -159,23 +159,14 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do @@ -159,23 +159,14 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
159 end 159 end
160 160
161 describe "the note form" do 161 describe "the note form" do
162 - # FIXME  
163 - #it 'should be valid' do  
164 - #within(".js-temp-notes-holder") { find("#note_noteable_type").value.should == "MergeRequest" }  
165 - #within(".js-temp-notes-holder") { find("#note_noteable_id").value.should == merge_request.id.to_s }  
166 - #within(".js-temp-notes-holder") { find("#note_commit_id").value.should == "" }  
167 - #within(".js-temp-notes-holder") { find("#note_line_code").value.should == "4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185" }  
168 - #should have_css(".js-close-discussion-note-form", text: "Cancel")  
169 - #end  
170 -  
171 it "shouldn't add a second form for same row" do 162 it "shouldn't add a second form for same row" do
172 - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click 163 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
173 164
174 - should have_css("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185'] + .js-temp-notes-holder form", count: 1) 165 + should have_css("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185'] + .js-temp-notes-holder form", count: 1)
175 end 166 end
176 167
177 it "should be removed when canceled" do 168 it "should be removed when canceled" do
178 - within(".file form[rel$='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185']") do 169 + within(".file form[rel$='4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185']") do
179 find(".js-close-discussion-note-form").trigger("click") 170 find(".js-close-discussion-note-form").trigger("click")
180 end 171 end
181 172
@@ -185,11 +176,11 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do @@ -185,11 +176,11 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
185 end 176 end
186 177
187 describe "with muliple note forms" do 178 describe "with muliple note forms" do
188 - let!(:project) { create(:source_project) } 179 + let!(:project) { create(:project) }
189 let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) } 180 let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) }
190 181
191 before do 182 before do
192 - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click 183 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
193 find('a[data-line-code="342e16cbbd482ac2047dc679b2749d248cc1428f_18_17"]').click 184 find('a[data-line-code="342e16cbbd482ac2047dc679b2749d248cc1428f_18_17"]').click
194 end 185 end
195 186
@@ -198,7 +189,7 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do @@ -198,7 +189,7 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
198 describe "previewing them separately" do 189 describe "previewing them separately" do
199 before do 190 before do
200 # add two separate texts and trigger previews on both 191 # add two separate texts and trigger previews on both
201 - within("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185'] + .js-temp-notes-holder") do 192 + within("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185'] + .js-temp-notes-holder") do
202 fill_in "note[note]", with: "One comment on line 185" 193 fill_in "note[note]", with: "One comment on line 185"
203 find(".js-note-preview-button").trigger("click") 194 find(".js-note-preview-button").trigger("click")
204 end 195 end