diff options
Diffstat (limited to 'spec/features/read_only_spec.rb')
-rw-r--r-- | spec/features/read_only_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/features/read_only_spec.rb b/spec/features/read_only_spec.rb index eb043d2193a..11686552062 100644 --- a/spec/features/read_only_spec.rb +++ b/spec/features/read_only_spec.rb @@ -9,19 +9,19 @@ RSpec.describe 'read-only message' do sign_in(user) end - it 'shows read-only banner when database is read-only' do - allow(Gitlab::Database).to receive(:read_only?).and_return(true) + context 'when database is read-only' do + before do + allow(Gitlab::Database).to receive(:read_only?).and_return(true) + end - visit root_dashboard_path - - expect(page).to have_content('You are on a read-only GitLab instance.') + it_behaves_like 'Read-only instance', /You are on a read\-only GitLab instance./ end - it 'does not show read-only banner when database is able to read-write' do - allow(Gitlab::Database).to receive(:read_only?).and_return(false) - - visit root_dashboard_path + context 'when database is in read-write mode' do + before do + allow(Gitlab::Database).to receive(:read_only?).and_return(false) + end - expect(page).not_to have_content('You are on a read-only GitLab instance.') + it_behaves_like 'Read-write instance', /You are on a read\-only GitLab instance./ end end |