File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
spec/rspec/rails/matchers Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -131,15 +131,15 @@ def mail_job_message(job)
131
131
end
132
132
133
133
def legacy_mail? ( job )
134
- job [ :job ] = = ActionMailer ::DeliveryJob
134
+ job [ :job ] < = ActionMailer ::DeliveryJob
135
135
end
136
136
137
137
def parameterized_mail? ( job )
138
- RSpec ::Rails ::FeatureCheck . has_action_mailer_parameterized? && job [ :job ] = = ActionMailer ::Parameterized ::DeliveryJob
138
+ RSpec ::Rails ::FeatureCheck . has_action_mailer_parameterized? && job [ :job ] < = ActionMailer ::Parameterized ::DeliveryJob
139
139
end
140
140
141
141
def unified_mail? ( job )
142
- RSpec ::Rails ::FeatureCheck . has_action_mailer_unified_delivery? && job [ :job ] = = ActionMailer ::MailDeliveryJob
142
+ RSpec ::Rails ::FeatureCheck . has_action_mailer_unified_delivery? && job [ :job ] < = ActionMailer ::MailDeliveryJob
143
143
end
144
144
end
145
145
# @api public
Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ class UnifiedMailer < ActionMailer::Base
21
21
def test_email ; end
22
22
def email_with_args ( arg1 , arg2 ) ; end
23
23
end
24
+
25
+ class SubClassDeliveryJob < ActionMailer ::DeliveryJob
26
+ end
27
+
28
+ class SubClassUnifiedMailer < ActionMailer ::Base
29
+ self . delivery_job = SubClassDeliveryJob
30
+
31
+ def test_email ; end
32
+ end
24
33
end
25
34
end
26
35
@@ -397,6 +406,12 @@ def self.name; "NonMailerJob"; end
397
406
a_hash_including ( params : { 'foo' => 'bar' } , args : [ 1 , 2 ] )
398
407
)
399
408
end
409
+
410
+ it "passes subclass delivery_job" do
411
+ expect {
412
+ SubClassUnifiedMailer . test_email . deliver_later
413
+ } . to have_enqueued_mail ( SubClassUnifiedMailer , :test_email )
414
+ end
400
415
end
401
416
end
402
417
end
You can’t perform that action at this time.
0 commit comments