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 135 end
136 136  
137 137 describe "On a merge request diff", js: true, focus: true do
138   - let!(:project) { create(:source_project) }
  138 + let!(:project) { create(:project) }
139 139 let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) }
140 140  
141 141 before do
... ... @@ -149,7 +149,7 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
149 149  
150 150 describe "when adding a note" do
151 151 before do
152   - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
  152 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
153 153 end
154 154  
155 155 describe "the notes holder" do
... ... @@ -159,23 +159,14 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
159 159 end
160 160  
161 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 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 166 end
176 167  
177 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 170 find(".js-close-discussion-note-form").trigger("click")
180 171 end
181 172  
... ... @@ -185,11 +176,11 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
185 176 end
186 177  
187 178 describe "with muliple note forms" do
188   - let!(:project) { create(:source_project) }
  179 + let!(:project) { create(:project) }
189 180 let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) }
190 181  
191 182 before do
192   - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
  183 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
193 184 find('a[data-line-code="342e16cbbd482ac2047dc679b2749d248cc1428f_18_17"]').click
194 185 end
195 186  
... ... @@ -198,7 +189,7 @@ describe &quot;On a merge request diff&quot;, js: true, focus: true do
198 189 describe "previewing them separately" do
199 190 before do
200 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 193 fill_in "note[note]", with: "One comment on line 185"
203 194 find(".js-note-preview-button").trigger("click")
204 195 end
... ...