summaryrefslogtreecommitdiff
path: root/spec/features/user_can_display_performance_bar_spec.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-07 16:30:50 +0100
committerSean McGivern <sean@gitlab.com>2017-07-07 16:30:50 +0100
commit9fc63aa7f65ef74eb40ebc884de8fc8e031969db (patch)
tree6a2960e829c944af70b3534c26481c7e13bc6a34 /spec/features/user_can_display_performance_bar_spec.rb
parentc179f507ee0731d26135c39f0198194968769151 (diff)
downloadgitlab-ce-9fc63aa7f65ef74eb40ebc884de8fc8e031969db.tar.gz
Fix performance bar specs
Diffstat (limited to 'spec/features/user_can_display_performance_bar_spec.rb')
-rw-r--r--spec/features/user_can_display_performance_bar_spec.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/spec/features/user_can_display_performance_bar_spec.rb b/spec/features/user_can_display_performance_bar_spec.rb
index a3adb8c2882..9452fe6d92a 100644
--- a/spec/features/user_can_display_performance_bar_spec.rb
+++ b/spec/features/user_can_display_performance_bar_spec.rb
@@ -33,6 +33,8 @@ 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
@@ -40,7 +42,7 @@ describe 'User can display performance bar', :js do
context 'when the performance_bar feature is disabled' do
before do
- Feature.disable(:performance_bar)
+ stub_application_setting(performance_bar_allowed_group_id: nil)
end
it_behaves_like 'performance bar is disabled'
@@ -48,7 +50,7 @@ describe 'User can display performance bar', :js do
context 'when the performance_bar feature is enabled' do
before do
- Feature.enable(:performance_bar)
+ stub_application_setting(performance_bar_allowed_group_id: group.id)
end
it_behaves_like 'performance bar is disabled'
@@ -57,14 +59,17 @@ 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 performance_bar feature is disabled' do
before do
- Feature.disable(:performance_bar)
+ stub_application_setting(performance_bar_allowed_group_id: nil)
end
it_behaves_like 'performance bar is disabled'
@@ -72,7 +77,7 @@ describe 'User can display performance bar', :js do
context 'when the performance_bar feature is enabled' do
before do
- Feature.enable(:performance_bar)
+ stub_application_setting(performance_bar_allowed_group_id: group.id)
end
it_behaves_like 'performance bar is enabled'