summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorElias Werberich <elias@endercoding.com>2016-03-24 11:12:45 +0100
committerElias Werberich <elias@endercoding.com>2016-03-24 19:59:54 +0100
commitc3a98d8fcc2f9f7a0ce8816c8cf9dbebe58e64e9 (patch)
tree51cff43a3df9b76919f17821b5afc4c57c311e71 /spec
parent5a460c3796b8083748747e004ee678045df0aca4 (diff)
downloadgitlab-ce-c3a98d8fcc2f9f7a0ce8816c8cf9dbebe58e64e9.tar.gz
Implementing 'Groups View' and 'TODOs View' as options for dashboard preferences.
Fixes #14585.
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/root_controller_spec.rb22
-rw-r--r--spec/helpers/preferences_helper_spec.rb4
2 files changed, 25 insertions, 1 deletions
diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb
index 5a104ae7c99..b14d275f7fa 100644
--- a/spec/controllers/root_controller_spec.rb
+++ b/spec/controllers/root_controller_spec.rb
@@ -43,6 +43,28 @@ describe RootController do
end
end
+ context 'who has customized their dashboard setting for groups' do
+ before do
+ user.update_attribute(:dashboard, 'groups')
+ end
+
+ 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
+ before do
+ user.update_attribute(:dashboard, 'todos')
+ end
+
+ it 'redirects to their todo list' do
+ get :index
+ expect(response).to redirect_to dashboard_todos_path
+ end
+ end
+
context 'who uses the default dashboard setting' do
it 'renders the default dashboard' do
get :index
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb
index e5df59c4fba..2f9291afc3f 100644
--- a/spec/helpers/preferences_helper_spec.rb
+++ b/spec/helpers/preferences_helper_spec.rb
@@ -19,7 +19,9 @@ describe PreferencesHelper do
['Your Projects (default)', 'projects'],
['Starred Projects', 'stars'],
["Your Projects' Activity", 'project_activity'],
- ["Starred Projects' Activity", 'starred_project_activity']
+ ["Starred Projects' Activity", 'starred_project_activity'],
+ ["Your Groups", 'groups'],
+ ["Your Todos", 'todos']
]
end
end