Commit 9fc63aa7 authored by Sean McGivern's avatar Sean McGivern

Fix performance bar specs

parent c179f507
...@@ -33,6 +33,8 @@ describe 'User can display performance bar', :js do ...@@ -33,6 +33,8 @@ describe 'User can display performance bar', :js do
end end
end end
let(:group) { create(:group) }
context 'when user is logged-out' do context 'when user is logged-out' do
before do before do
visit root_path visit root_path
...@@ -40,7 +42,7 @@ describe 'User can display performance bar', :js do ...@@ -40,7 +42,7 @@ describe 'User can display performance bar', :js do
context 'when the performance_bar feature is disabled' do context 'when the performance_bar feature is disabled' do
before do before do
Feature.disable(:performance_bar) stub_application_setting(performance_bar_allowed_group_id: nil)
end end
it_behaves_like 'performance bar is disabled' it_behaves_like 'performance bar is disabled'
...@@ -48,7 +50,7 @@ describe 'User can display performance bar', :js do ...@@ -48,7 +50,7 @@ describe 'User can display performance bar', :js do
context 'when the performance_bar feature is enabled' do context 'when the performance_bar feature is enabled' do
before do before do
Feature.enable(:performance_bar) stub_application_setting(performance_bar_allowed_group_id: group.id)
end end
it_behaves_like 'performance bar is disabled' it_behaves_like 'performance bar is disabled'
...@@ -57,14 +59,17 @@ describe 'User can display performance bar', :js do ...@@ -57,14 +59,17 @@ describe 'User can display performance bar', :js do
context 'when user is logged-in' do context 'when user is logged-in' do
before do before do
gitlab_sign_in(create(:user)) user = create(:user)
gitlab_sign_in(user)
group.add_guest(user)
visit root_path visit root_path
end end
context 'when the performance_bar feature is disabled' do context 'when the performance_bar feature is disabled' do
before do before do
Feature.disable(:performance_bar) stub_application_setting(performance_bar_allowed_group_id: nil)
end end
it_behaves_like 'performance bar is disabled' it_behaves_like 'performance bar is disabled'
...@@ -72,7 +77,7 @@ describe 'User can display performance bar', :js do ...@@ -72,7 +77,7 @@ describe 'User can display performance bar', :js do
context 'when the performance_bar feature is enabled' do context 'when the performance_bar feature is enabled' do
before do before do
Feature.enable(:performance_bar) stub_application_setting(performance_bar_allowed_group_id: group.id)
end end
it_behaves_like 'performance bar is enabled' it_behaves_like 'performance bar is enabled'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment