diff options
Diffstat (limited to 'spec/controllers/root_controller_spec.rb')
-rw-r--r-- | spec/controllers/root_controller_spec.rb | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb index 995f803d757..d89fd1f409e 100644 --- a/spec/controllers/root_controller_spec.rb +++ b/spec/controllers/root_controller_spec.rb @@ -1,28 +1,28 @@ -require 'spec_helper' +require "spec_helper" describe RootController do - describe 'GET index' do - context 'when user is not logged in' do - it 'redirects to the sign-in page' do + describe "GET index" do + context "when user is not logged in" do + it "redirects to the sign-in page" do get :index expect(response).to redirect_to(new_user_session_path) end - context 'when a custom home page URL is defined' do + context "when a custom home page URL is defined" do before do - stub_application_setting(home_page_url: 'https://gitlab.com') + stub_application_setting(home_page_url: "https://gitlab.com") end - it 'redirects the user to the custom home page URL' do + it "redirects the user to the custom home page URL" do get :index - expect(response).to redirect_to('https://gitlab.com') + expect(response).to redirect_to("https://gitlab.com") end end end - context 'with a user' do + context "with a user" do let(:user) { create(:user) } before do @@ -30,95 +30,95 @@ describe RootController do allow(subject).to receive(:current_user).and_return(user) end - context 'who has customized their dashboard setting for starred projects' do + context "who has customized their dashboard setting for starred projects" do before do - user.dashboard = 'stars' + user.dashboard = "stars" end - it 'redirects to their specified dashboard' do + it "redirects to their specified dashboard" do get :index expect(response).to redirect_to starred_dashboard_projects_path end end - context 'who has customized their dashboard setting for project activities' do + context "who has customized their dashboard setting for project activities" do before do - user.dashboard = 'project_activity' + user.dashboard = "project_activity" end - it 'redirects to the activity list' do + it "redirects to the activity list" do get :index expect(response).to redirect_to activity_dashboard_path end end - context 'who has customized their dashboard setting for starred project activities' do + context "who has customized their dashboard setting for starred project activities" do before do - user.dashboard = 'starred_project_activity' + user.dashboard = "starred_project_activity" end - it 'redirects to the activity list' do + it "redirects to the activity list" do get :index - expect(response).to redirect_to activity_dashboard_path(filter: 'starred') + expect(response).to redirect_to activity_dashboard_path(filter: "starred") end end - context 'who has customized their dashboard setting for groups' do + context "who has customized their dashboard setting for groups" do before do - user.dashboard = 'groups' + user.dashboard = "groups" end - it 'redirects to their group list' do + it "redirects to their group list" do get :index expect(response).to redirect_to dashboard_groups_path end end - context 'who has customized their dashboard setting for todos' do + context "who has customized their dashboard setting for todos" do before do - user.dashboard = 'todos' + user.dashboard = "todos" end - it 'redirects to their todo list' do + it "redirects to their todo list" do get :index expect(response).to redirect_to dashboard_todos_path end end - context 'who has customized their dashboard setting for assigned issues' do + context "who has customized their dashboard setting for assigned issues" do before do - user.dashboard = 'issues' + user.dashboard = "issues" end - it 'redirects to their assigned issues' do + it "redirects to their assigned issues" do get :index expect(response).to redirect_to issues_dashboard_path(assignee_username: user.username) end end - context 'who has customized their dashboard setting for assigned merge requests' do + context "who has customized their dashboard setting for assigned merge requests" do before do - user.dashboard = 'merge_requests' + user.dashboard = "merge_requests" end - it 'redirects to their assigned merge requests' do + it "redirects to their assigned merge requests" do get :index expect(response).to redirect_to merge_requests_dashboard_path(assignee_username: user.username) end end - context 'who uses the default dashboard setting' do - it 'renders the default dashboard' do + context "who uses the default dashboard setting" do + it "renders the default dashboard" do get :index - expect(response).to render_template 'dashboard/projects/index' + expect(response).to render_template "dashboard/projects/index" end end end |