Commit 953db8477e301d6cbd9ddf560264da708cd92aba

Authored by Dmitriy Zaporozhets
1 parent 211c06e4

More fixes for test

features/steps/project/project_merge_requests.rb
@@ -103,21 +103,19 @@ class ProjectMergeRequests < Spinach::FeatureSteps @@ -103,21 +103,19 @@ class ProjectMergeRequests < Spinach::FeatureSteps
103 end 103 end
104 104
105 And 'I leave a comment on the diff page' do 105 And 'I leave a comment on the diff page' do
106 - within(:xpath, "//div[@class='note-form-holder']") do 106 + within('.js-temp-notes-holder') do
107 fill_in "note_note", with: "One comment to rule them all" 107 fill_in "note_note", with: "One comment to rule them all"
108 click_button "Add Comment" 108 click_button "Add Comment"
109 end 109 end
110 end 110 end
111 111
112 And 'I leave a comment like "Line is wrong" on line 185 of the first file' do 112 And 'I leave a comment like "Line is wrong" on line 185 of the first file' do
113 - save_and_open_page  
114 - within(:xpath, "//div[@class='diff_file'][1]") do  
115 - click_link "add-diff-line-note-0_185_185"  
116 - end 113 + find("#4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185 .add-diff-note").click
117 114
118 - within(:xpath, "//div[@class='line-note-form-holder']") do 115 + within(".js-temp-notes-holder") do
119 fill_in "note_note", with: "Line is wrong" 116 fill_in "note_note", with: "Line is wrong"
120 click_button "Add Comment" 117 click_button "Add Comment"
  118 + sleep 0.05
121 end 119 end
122 end 120 end
123 121
features/steps/shared/diff_note.rb
@@ -8,6 +8,7 @@ module SharedDiffNote @@ -8,6 +8,7 @@ module SharedDiffNote
8 end 8 end
9 9
10 Given 'I delete a diff comment' do 10 Given 'I delete a diff comment' do
  11 + sleep 1
11 within(".diff_file") do 12 within(".diff_file") do
12 first(".js-note-delete").trigger("click") 13 first(".js-note-delete").trigger("click")
13 end 14 end
@@ -25,6 +26,7 @@ module SharedDiffNote @@ -25,6 +26,7 @@ module SharedDiffNote
25 fill_in "note[note]", with: "Typo, please fix" 26 fill_in "note[note]", with: "Typo, please fix"
26 #click_button("Add Comment") 27 #click_button("Add Comment")
27 find(".js-comment-button").trigger("click") 28 find(".js-comment-button").trigger("click")
  29 + sleep 0.05
28 end 30 end
29 end 31 end
30 32
features/steps/shared/note.rb
@@ -39,8 +39,6 @@ module SharedNote @@ -39,8 +39,6 @@ module SharedNote
39 end 39 end
40 end 40 end
41 41
42 -  
43 -  
44 Then 'I should not see a comment saying "XML attached"' do 42 Then 'I should not see a comment saying "XML attached"' do
45 page.should_not have_css(".note") 43 page.should_not have_css(".note")
46 end 44 end
@@ -113,4 +111,10 @@ module SharedNote @@ -113,4 +111,10 @@ module SharedNote
113 Then 'I should see project wall note "my special test message"' do 111 Then 'I should see project wall note "my special test message"' do
114 page.should have_content "my special test message" 112 page.should have_content "my special test message"
115 end 113 end
  114 +
  115 + Then 'I should see comment "XML attached"' do
  116 + within(".note") do
  117 + page.should have_content("XML attached")
  118 + end
  119 + end
116 end 120 end