File tree 2 files changed +13
-1
lines changed
spec/rspec/rails/matchers
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def deserialize_arguments(job)
145
145
if hash . key? ( "_aj_ruby2_keywords" )
146
146
keywords = hash [ "_aj_ruby2_keywords" ]
147
147
148
- original_hash = keywords . each_with_object ( { } ) { |new_hash , keyword | new_hash [ keyword . to_sym ] = hash [ keyword ] }
148
+ original_hash = keywords . each_with_object ( { } ) { |keyword , new_hash | new_hash [ keyword . to_sym ] = hash [ keyword ] }
149
149
150
150
args + [ original_hash ]
151
151
elsif hash . key? ( :args ) && hash . key? ( :params )
Original file line number Diff line number Diff line change 4
4
require "action_mailer"
5
5
require "rspec/rails/matchers/have_enqueued_mail"
6
6
7
+ class GlobalIDArgument
8
+ include GlobalID ::Identification
9
+ def id ; 1 ; end
10
+ def to_global_id ( options = { } ) ; super ( options . merge ( app : 'rspec-rails' ) ) ; end
11
+ end
12
+
7
13
class TestMailer < ActionMailer ::Base
8
14
def test_email ; end
9
15
def email_with_args ( arg1 , arg2 ) ; end
@@ -418,6 +424,12 @@ def self.name; "NonMailerJob"; end
418
424
)
419
425
end
420
426
427
+ it "passes when given a global id serialised argument" do
428
+ expect {
429
+ UnifiedMailer . with ( inquiry : GlobalIDArgument . new ) . test_email . deliver_later
430
+ } . to have_enqueued_email ( UnifiedMailer , :test_email )
431
+ end
432
+
421
433
it "passes when using a mailer with `delivery_job` set to a sub class of `ActionMailer::DeliveryJob`" do
422
434
expect {
423
435
UnifiedMailerWithDeliveryJobSubClass . test_email . deliver_later
You can’t perform that action at this time.
0 commit comments