summaryrefslogtreecommitdiff
path: root/spec/requests/top_panel_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/top_panel_spec.rb')
-rw-r--r--spec/requests/top_panel_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/requests/top_panel_spec.rb b/spec/requests/top_panel_spec.rb
new file mode 100644
index 00000000000..bd4d2047796
--- /dev/null
+++ b/spec/requests/top_panel_spec.rb
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+describe "Top Panel", :js => true do
+ before { login_as :user }
+
+ describe "Search autocomplete" do
+ before do
+ 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
+ current_path.should == keys_path
+ end
+ end
+
+ describe "with project" do
+ before do
+ @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
+ current_path.should == project_commits_path(@project)
+ end
+ end
+end