summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-10 04:42:02 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-13 17:59:11 -0400
commit1eb9a02f21d45f2fa301576723bbb0a23b5ba22d (patch)
tree749c9e8205f023489dfb8bb1d83477787d88194c /spec
parent6de3958364f8d2adb68b8beecd53e4af6b17c353 (diff)
downloadgitlab-ce-1eb9a02f21d45f2fa301576723bbb0a23b5ba22d.tar.gz
Add a form field to customize the dashboard preference
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/preferences_helper_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb
index 095b016e6ec..e8d8c4ceb87 100644
--- a/spec/helpers/preferences_helper_spec.rb
+++ b/spec/helpers/preferences_helper_spec.rb
@@ -30,6 +30,23 @@ describe PreferencesHelper do
end
end
+ describe 'dashboard_choices' do
+ it 'raises an exception when defined choices may be missing' do
+ dashboards = User.dashboards
+ expect(User).to receive(:dashboards).
+ and_return(dashboards.merge(foo: 'foo'))
+
+ expect { dashboard_choices }.to raise_error
+ end
+
+ it 'provides better option descriptions' do
+ choices = dashboard_choices
+
+ expect(choices[0]).to eq ['Projects (default)', 'projects']
+ expect(choices[1]).to eq ['Starred Projects', 'stars']
+ end
+ end
+
describe 'user_color_scheme_class' do
context 'with current_user is nil' do
it 'should return a string' do