Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-01-02 17:22:57 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-01-02 17:22:57 +0300
commit453bcfb3f34b61f94c51d8c5e8de4f2ae6ee309c (patch)
tree5e26cf6a84965e5b785009587087f2c264f17d37 /spec
parent191f461b88ba80069c2b23229cc0e26253d4fcc7 (diff)
parentf40478fe194113722d5db5e066acde37a7cdbd85 (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.rb17
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