summaryrefslogtreecommitdiff
path: root/spec/helpers/preferences_helper_spec.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-25 17:04:20 -0700
committerStan Hu <stanhu@gmail.com>2015-09-26 08:46:05 -0700
commit0383afc66ab889afc6af02203902d1d515723a96 (patch)
tree671139b4d862fa7c04ec5a1930dd3f8cf22dfefc /spec/helpers/preferences_helper_spec.rb
parent6d6918105941bcb868b59350f56eb2f76efd7cf5 (diff)
downloadgitlab-ce-0383afc66ab889afc6af02203902d1d515723a96.tar.gz
Add user preference to view project activity and starred project activity as default dashboard
Closes #2662
Diffstat (limited to 'spec/helpers/preferences_helper_spec.rb')
-rw-r--r--spec/helpers/preferences_helper_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb
index 06f69262b71..e5df59c4fba 100644
--- a/spec/helpers/preferences_helper_spec.rb
+++ b/spec/helpers/preferences_helper_spec.rb
@@ -8,14 +8,18 @@ describe PreferencesHelper do
end
it 'raises an exception when defined choices may be using the wrong key' do
- expect(User).to receive(:dashboards).and_return(foo: 'foo', bar: 'bar')
+ dashboards = User.dashboards.dup
+ dashboards[:projects_changed] = dashboards.delete :projects
+ expect(User).to receive(:dashboards).and_return(dashboards)
expect { helper.dashboard_choices }.to raise_error(KeyError)
end
it 'provides better option descriptions' do
expect(helper.dashboard_choices).to match_array [
['Your Projects (default)', 'projects'],
- ['Starred Projects', 'stars']
+ ['Starred Projects', 'stars'],
+ ["Your Projects' Activity", 'project_activity'],
+ ["Starred Projects' Activity", 'starred_project_activity']
]
end
end