2011-10-08 23:36:38 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Top Panel", :js => true do
|
|
|
|
before { login_as :user }
|
|
|
|
|
|
|
|
describe "Search autocomplete" do
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2011-10-08 23:36:38 +02:00
|
|
|
visit projects_path
|
|
|
|
fill_in "search", :with => "Ke"
|
|
|
|
sleep(2)
|
|
|
|
find(:xpath, "//ul[contains(@class,'ui-autocomplete')]/li/a[.=\"Keys\"]").click
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be on projects page" do
|
2011-10-26 15:46:25 +02:00
|
|
|
current_path.should == keys_path
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "with project" do
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2011-10-08 23:36:38 +02:00
|
|
|
@project = Factory :project
|
|
|
|
@project.add_access(@user, :read)
|
|
|
|
visit project_path(@project)
|
|
|
|
|
|
|
|
fill_in "search", :with => "Commi"
|
|
|
|
sleep(2)
|
|
|
|
find(:xpath, "//ul[contains(@class,'ui-autocomplete')]/li/a[.=\"#{@project.code} / Commits\"]").click
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be on projects page" do
|
2011-10-26 15:46:25 +02:00
|
|
|
current_path.should == project_commits_path(@project)
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|