gitlab-org--gitlab-foss/spec/controllers/root_controller_spec.rb
Robert Speicher 94d3c1433d Add RootController
This controller is now the target for `root_url`. It sub-classes
DashboardController so we can render the old default without a redirect
if the user hasn't customized their dashboard location.
2015-06-13 17:59:11 -04:00

32 lines
800 B
Ruby

require 'spec_helper'
describe RootController do
describe 'GET show' do
context 'with a user' do
let(:user) { create(:user) }
before do
sign_in(user)
allow(subject).to receive(:current_user).and_return(user)
end
context 'who has customized their dashboard setting' do
before do
user.update_attribute(:dashboard, 'stars')
end
it 'redirects to their specified dashboard' do
get :show
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'
end
end
end
end
end