Commit 1489d225 authored by Douwe Maan's avatar Douwe Maan

Move partial to right place and fix tests.

parent 5d785457
......@@ -15,7 +15,7 @@ class GroupsController < Groups::ApplicationController
layout :determine_layout
def index
redirect_to (current_user ? dashboard_groups_path : explore_groups_path)
redirect_to(current_user ? dashboard_groups_path : explore_groups_path)
end
def new
......
......@@ -11,7 +11,7 @@ class ProjectsController < ApplicationController
layout :determine_layout
def index
redirect_to (current_user ? root_path : explore_root_path)
redirect_to(current_user ? root_path : explore_root_path)
end
def new
......
......@@ -26,7 +26,7 @@ class SnippetsController < ApplicationController
render 'index'
else
redirect_to (current_user ? dashboard_snippets_path : explore_snippets_path)
redirect_to(current_user ? dashboard_snippets_path : explore_snippets_path)
end
end
......
require 'spec_helper'
describe RootController do
describe 'GET show' do
describe 'GET index' do
context 'with a user' do
let(:user) { create(:user) }
......@@ -16,15 +16,15 @@ describe RootController do
end
it 'redirects to their specified dashboard' do
get :show
get :index
expect(response).to redirect_to starred_dashboard_projects_path
end
end
context 'who uses the default dashboard setting' do
it 'renders the default dashboard' do
get :show
expect(response).to render_template 'dashboard/show'
get :index
expect(response).to render_template 'dashboard/projects/index'
end
end
end
......
......@@ -206,7 +206,7 @@ end
# dashboard_merge_requests GET /dashboard/merge_requests(.:format) dashboard#merge_requests
describe DashboardController, "routing" do
it "to #index" do
expect(get("/dashboard")).to route_to('dashboard#show')
expect(get("/dashboard")).to route_to('dashboard/projects#index')
end
it "to #issues" do
......@@ -220,8 +220,8 @@ end
# root / root#show
describe RootController, 'routing' do
it 'to #show' do
expect(get('/')).to route_to('root#show')
it 'to #index' do
expect(get('/')).to route_to('root#index')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment