Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-09-24 00:18:15 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-09-24 00:18:15 +0300
commit45824aabc634e06d9f7dd853e573c153b7bf9a78 (patch)
treead3e3c754a7c3d637487ffca277f35216ea1b473 /spec/views
parentbe142e6bd687d223dd4a543295d18676f408b7e3 (diff)
Allow non-admin users to see version information
We want users to know what features they have available (and to pressure their admins to upgrade).
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/help/index.html.haml_spec.rb23
1 files changed, 5 insertions, 18 deletions
diff --git a/spec/views/help/index.html.haml_spec.rb b/spec/views/help/index.html.haml_spec.rb
index 91cf4cb98c0..6b07fcfc987 100644
--- a/spec/views/help/index.html.haml_spec.rb
+++ b/spec/views/help/index.html.haml_spec.rb
@@ -3,18 +3,7 @@ require 'rails_helper'
describe 'help/index' do
describe 'version information' do
it 'is hidden from guests' do
- stub_user
- stub_version('8.0.2', 'abcdefg')
- stub_helpers
-
- render
-
- expect(rendered).not_to match '8.0.2'
- expect(rendered).not_to match 'abcdefg'
- end
-
- it 'is hidden from users' do
- stub_user(admin?: false)
+ stub_user(nil)
stub_version('8.0.2', 'abcdefg')
stub_helpers
@@ -24,8 +13,8 @@ describe 'help/index' do
expect(rendered).not_to match 'abcdefg'
end
- it 'is shown to admins' do
- stub_user(admin?: true)
+ it 'is shown to users' do
+ stub_user
stub_version('8.0.2', 'abcdefg')
stub_helpers
@@ -36,10 +25,8 @@ describe 'help/index' do
end
end
- def stub_user(messages = {})
- user = messages.empty? ? nil : double(messages)
-
- allow(view).to receive(:current_user).and_return(user)
+ def stub_user(user = double)
+ allow(view).to receive(:user_signed_in?).and_return(user)
end
def stub_version(version, revision)