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:
authorYorick Peterse <yorickpeterse@gmail.com>2019-01-24 15:49:58 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2019-01-24 15:50:01 +0300
commit52a93abb838105fb6eb4cb130161d7db2bb6f9c6 (patch)
tree92e4cf0fefdbd4971cde9017506b858a6d0c21d9 /spec
parent26faee772e6956c3949ee227fe1fbb81a90c6a30 (diff)
Merge branch 'security-bump-rails-version-11-6' into 'security-11-6'
[11.6] Bump Rails version to 5.0.7.1 See merge request gitlab/gitlabhq!2797 (cherry picked from commit 3a5dd09effda664888b25c935142b5c8fc23c304) f705c816 Bump Ruby on Rails version to 5.0.7.1
Diffstat (limited to 'spec')
-rw-r--r--spec/workers/mail_scheduler/notification_service_worker_spec.rb28
1 files changed, 16 insertions, 12 deletions
diff --git a/spec/workers/mail_scheduler/notification_service_worker_spec.rb b/spec/workers/mail_scheduler/notification_service_worker_spec.rb
index e726f469816..1033557ee88 100644
--- a/spec/workers/mail_scheduler/notification_service_worker_spec.rb
+++ b/spec/workers/mail_scheduler/notification_service_worker_spec.rb
@@ -16,18 +16,22 @@ describe MailScheduler::NotificationServiceWorker do
worker.perform(method, *serialize(key))
end
- # actionmailer wasn't actually upgraded from 4.2.10 to 4.2.11 in
- # https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23520.
- #
- # Attempting to run this spec in Rails 4 will fail until
- # https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23396
- # is merged. Let's disable it since we are only using Rails 5 on
- # this branch.
- context 'when the arguments cannot be deserialized', :rails5 do
- it 'does nothing' do
- expect(worker.notification_service).not_to receive(method)
-
- worker.perform(method, key.to_global_id.to_s.succ)
+ context 'when the arguments cannot be deserialized' do
+ 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!
+
+ expect(worker.notification_service).not_to receive(method)
+ expect { worker.perform(method, serialized_arguments) }.not_to raise_exception
+ end
end
end