Dashboard refactoring:
* dashboard should be in dashboard controller not project index * projects index removed
This commit is contained in:
parent
9ef9c58f55
commit
edd81a79c5
15 changed files with 84 additions and 101 deletions
39
spec/requests/dashboard_spec.rb
Normal file
39
spec/requests/dashboard_spec.rb
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue