summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-07 18:18:22 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-07 18:18:22 +0000
commitb151951418bda31e3acdfe1dcb214b4d244f8566 (patch)
tree854869d47bec521baba35849a71397f2f323023b /spec/features
parent3ba7c004445d436f616814bf278fb60ffc9fc592 (diff)
parent8b33e654c09aaa20545e7c246585fa2d3217cecb (diff)
downloadgitlab-ce-b151951418bda31e3acdfe1dcb214b4d244f8566.tar.gz
Merge branch '33929-allow-to-enable-perf-bar-for-a-group' into 'master'
Allow to enable the performance bar per user or Feature group Closes #33929 and #34528 See merge request !12362
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/user_can_display_performance_bar_spec.rb23
1 files changed, 14 insertions, 9 deletions
diff --git a/spec/features/user_can_display_performance_bar_spec.rb b/spec/features/user_can_display_performance_bar_spec.rb
index 24fff1a3052..9452fe6d92a 100644
--- a/spec/features/user_can_display_performance_bar_spec.rb
+++ b/spec/features/user_can_display_performance_bar_spec.rb
@@ -33,22 +33,24 @@ describe 'User can display performance bar', :js do
end
end
+ let(:group) { create(:group) }
+
context 'when user is logged-out' do
before do
visit root_path
end
- context 'when the gitlab_performance_bar feature is disabled' do
+ context 'when the performance_bar feature is disabled' do
before do
- Feature.disable('gitlab_performance_bar')
+ stub_application_setting(performance_bar_allowed_group_id: nil)
end
it_behaves_like 'performance bar is disabled'
end
- context 'when the gitlab_performance_bar feature is enabled' do
+ context 'when the performance_bar feature is enabled' do
before do
- Feature.enable('gitlab_performance_bar')
+ stub_application_setting(performance_bar_allowed_group_id: group.id)
end
it_behaves_like 'performance bar is disabled'
@@ -57,22 +59,25 @@ describe 'User can display performance bar', :js do
context 'when user is logged-in' do
before do
- gitlab_sign_in(create(:user))
+ user = create(:user)
+
+ gitlab_sign_in(user)
+ group.add_guest(user)
visit root_path
end
- context 'when the gitlab_performance_bar feature is disabled' do
+ context 'when the performance_bar feature is disabled' do
before do
- Feature.disable('gitlab_performance_bar')
+ stub_application_setting(performance_bar_allowed_group_id: nil)
end
it_behaves_like 'performance bar is disabled'
end
- context 'when the gitlab_performance_bar feature is enabled' do
+ context 'when the performance_bar feature is enabled' do
before do
- Feature.enable('gitlab_performance_bar')
+ stub_application_setting(performance_bar_allowed_group_id: group.id)
end
it_behaves_like 'performance bar is enabled'