diff options
Diffstat (limited to 'spec/services/packages')
-rw-r--r-- | spec/services/packages/create_event_service_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/services/packages/create_event_service_spec.rb b/spec/services/packages/create_event_service_spec.rb index 55703e9127f..4db7687bb24 100644 --- a/spec/services/packages/create_event_service_spec.rb +++ b/spec/services/packages/create_event_service_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Packages::CreateEventService do stub_feature_flags(collect_package_events: false) end - it 'does not create an event object' do + it 'does not create an event' do expect { subject }.not_to change { Packages::Event.count } end end @@ -43,6 +43,16 @@ RSpec.describe Packages::CreateEventService do expect(subject.event_scope).to eq(expected_scope) expect(subject.event_type).to eq(event_name) end + + context 'on a read-only instance' do + before do + allow(Gitlab::Database).to receive(:read_only?).and_return(true) + end + + it 'does not create an event' do + expect { subject }.not_to change { Packages::Event.count } + end + end end end |