Commit de09e356934cb90546de7ebf1c4e721a31518235

Authored by Dmitriy Zaporozhets
1 parent 48a1e310

refactored top panel spec

Showing 1 changed file with 6 additions and 4 deletions   Show diff stats
spec/requests/top_panel_spec.rb
@@ -7,8 +7,9 @@ describe "Top Panel", :js => true do @@ -7,8 +7,9 @@ describe "Top Panel", :js => true do
7 before do 7 before do
8 visit projects_path 8 visit projects_path
9 fill_in "search", :with => "Ke" 9 fill_in "search", :with => "Ke"
10 - sleep(2)  
11 - find(:xpath, "//ul[contains(@class,'ui-autocomplete')]/li/a[.=\"Keys\"]").click 10 + within ".ui-autocomplete" do
  11 + find(:xpath, "//a[.=\"Keys\"]").click
  12 + end
12 end 13 end
13 14
14 it "should be on projects page" do 15 it "should be on projects page" do
@@ -23,8 +24,9 @@ describe "Top Panel", :js => true do @@ -23,8 +24,9 @@ describe "Top Panel", :js => true do
23 visit project_path(@project) 24 visit project_path(@project)
24 25
25 fill_in "search", :with => "Commi" 26 fill_in "search", :with => "Commi"
26 - sleep(2)  
27 - find(:xpath, "//ul[contains(@class,'ui-autocomplete')]/li/a[.=\"#{@project.code} / Commits\"]").click 27 + within ".ui-autocomplete" do
  28 + find(:xpath, "//a[.=\"#{@project.code} / Commits\"]").click
  29 + end
28 end 30 end
29 31
30 it "should be on projects page" do 32 it "should be on projects page" do