diff options
Diffstat (limited to 'spec/requests')
| -rw-r--r-- | spec/requests/dashboard_spec.rb | 39 | ||||
| -rw-r--r-- | spec/requests/last_push_widget_spec.rb | 2 | ||||
| -rw-r--r-- | spec/requests/projects_security_spec.rb | 16 | ||||
| -rw-r--r-- | spec/requests/projects_spec.rb | 36 | ||||
| -rw-r--r-- | spec/requests/top_panel_spec.rb | 37 |
5 files changed, 49 insertions, 81 deletions
diff --git a/spec/requests/dashboard_spec.rb b/spec/requests/dashboard_spec.rb new file mode 100644 index 00000000000..16ededd02af --- /dev/null +++ b/spec/requests/dashboard_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +describe "User Dashboard" do + before { login_as :user } + + describe "GET /" do + before do + @project = Factory :project, :owner => @user + @project.add_access(@user, :read) + visit dashboard_path + end + + it "should be on projects page" do + current_path.should == dashboard_path + end + + it "should have link to new project" do + page.should have_content("New Project") + end + + it "should have project" do + page.should have_content(@project.name) + end + + it "should render projects atom feed via private token" do + logout + + visit dashboard_path(:atom, :private_token => @user.private_token) + page.body.should have_selector("feed title") + end + + it "should not render projects page via private token" do + logout + + visit dashboard_path(:private_token => @user.private_token) + current_path.should == new_user_session_path + end + end +end diff --git a/spec/requests/last_push_widget_spec.rb b/spec/requests/last_push_widget_spec.rb index f3d06e86603..831359a71cd 100644 --- a/spec/requests/last_push_widget_spec.rb +++ b/spec/requests/last_push_widget_spec.rb @@ -7,7 +7,7 @@ describe "Last Push widget" do @project = Factory :project, :owner => @user @project.add_access(@user, :read) create_push_event - visit projects_path + visit dashboard_path end it "should display last push widget with link to merge request page" do diff --git a/spec/requests/projects_security_spec.rb b/spec/requests/projects_security_spec.rb index cf97716cc59..df4d11221c3 100644 --- a/spec/requests/projects_security_spec.rb +++ b/spec/requests/projects_security_spec.rb @@ -1,16 +1,16 @@ require 'spec_helper' -describe "Projects" do - describe "GET /projects" do - it { projects_path.should be_allowed_for :admin } - it { projects_path.should be_allowed_for :user } - it { projects_path.should be_denied_for :visitor } +describe "Projects Security" do + describe "GET /" do + it { root_path.should be_allowed_for :admin } + it { root_path.should be_allowed_for :user } + it { root_path.should be_denied_for :visitor } end describe "GET /projects/new" do - it { projects_path.should be_allowed_for :admin } - it { projects_path.should be_allowed_for :user } - it { projects_path.should be_denied_for :visitor } + it { new_project_path.should be_allowed_for :admin } + it { new_project_path.should be_allowed_for :user } + it { new_project_path.should be_denied_for :visitor } end describe "Project" do diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb index 79c9495539b..b55a4db5706 100644 --- a/spec/requests/projects_spec.rb +++ b/spec/requests/projects_spec.rb @@ -3,43 +3,9 @@ require 'spec_helper' describe "Projects" do before { login_as :user } - describe "GET /projects" do - before do - @project = Factory :project, :owner => @user - @project.add_access(@user, :read) - visit projects_path - end - - it "should be on projects page" do - current_path.should == projects_path - end - - it "should have link to new project" do - page.should have_content("New Project") - end - - it "should have project" do - page.should have_content(@project.name) - end - - it "should render projects atom feed via private token" do - logout - - visit projects_path(:atom, :private_token => @user.private_token) - page.body.should have_selector("feed title") - end - - it "should not render projects page via private token" do - logout - - visit projects_path(:private_token => @user.private_token) - current_path.should == new_user_session_path - end - end - describe "GET /projects/new" do before do - visit projects_path + visit root_path click_link "New Project" end diff --git a/spec/requests/top_panel_spec.rb b/spec/requests/top_panel_spec.rb deleted file mode 100644 index 1be0789b604..00000000000 --- a/spec/requests/top_panel_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -__END__ -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" - within ".ui-autocomplete" do - find(:xpath, "//a[.=\"Keys\"]").click - end - 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" - within ".ui-autocomplete" do - find(:xpath, "//a[.=\"#{@project.code} / Commits\"]").click - end - end - - it "should be on projects page" do - current_path.should == project_commits_path(@project) - end - end -end |
