File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
spec/rspec/rails/matchers Expand file tree Collapse file tree 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)
145145 if hash . key? ( "_aj_ruby2_keywords" )
146146 keywords = hash [ "_aj_ruby2_keywords" ]
147147
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 ] }
149149
150150 args + [ original_hash ]
151151 elsif hash . key? ( :args ) && hash . key? ( :params )
Original file line number Diff line number Diff line change 44 require "action_mailer"
55 require "rspec/rails/matchers/have_enqueued_mail"
66
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+
713 class TestMailer < ActionMailer ::Base
814 def test_email ; end
915 def email_with_args ( arg1 , arg2 ) ; end
@@ -418,6 +424,12 @@ def self.name; "NonMailerJob"; end
418424 )
419425 end
420426
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+
421433 it "passes when using a mailer with `delivery_job` set to a sub class of `ActionMailer::DeliveryJob`" do
422434 expect {
423435 UnifiedMailerWithDeliveryJobSubClass . test_email . deliver_later
You can’t perform that action at this time.
0 commit comments