diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-01-02 17:22:57 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-01-02 17:22:57 +0300 |
commit | 453bcfb3f34b61f94c51d8c5e8de4f2ae6ee309c (patch) | |
tree | 5e26cf6a84965e5b785009587087f2c264f17d37 /spec | |
parent | 191f461b88ba80069c2b23229cc0e26253d4fcc7 (diff) | |
parent | f40478fe194113722d5db5e066acde37a7cdbd85 (diff) |
Merge branch 'blackst0ne-bump-rails-cve-2018-16476' into 'master'
Bump Ruby on Rails to 5.0.7.1
See merge request gitlab-org/gitlab-ce!23396
Diffstat (limited to 'spec')
-rw-r--r-- | spec/workers/mail_scheduler/notification_service_worker_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/workers/mail_scheduler/notification_service_worker_spec.rb b/spec/workers/mail_scheduler/notification_service_worker_spec.rb index f725c8763a0..1033557ee88 100644 --- a/spec/workers/mail_scheduler/notification_service_worker_spec.rb +++ b/spec/workers/mail_scheduler/notification_service_worker_spec.rb @@ -17,10 +17,21 @@ describe MailScheduler::NotificationServiceWorker do end context 'when the arguments cannot be deserialized' do - it 'does nothing' do - expect(worker.notification_service).not_to receive(method) + context 'when the arguments are not deserializeable' do + it 'raises exception' do + expect(worker.notification_service).not_to receive(method) + expect { worker.perform(method, key.to_global_id.to_s.succ) }.to raise_exception(ArgumentError) + end + end + + context 'when the arguments are deserializeable' do + it 'does nothing' do + serialized_arguments = *serialize(key) + key.destroy! - worker.perform(method, key.to_global_id.to_s.succ) + expect(worker.notification_service).not_to receive(method) + expect { worker.perform(method, serialized_arguments) }.not_to raise_exception + end end end |