Skip to content

Commit b361e1c

Browse files
fabnpirj
authored andcommitted
Clarify examples with better params usage
1 parent 81f51b4 commit b361e1c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

features/matchers/have_enqueued_mail_matcher.feature

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ Feature: have_enqueued_mail matcher
7373
"""ruby
7474
class MyMailer < ApplicationMailer
7575
76-
def signup(user = nil)
77-
@user = user
76+
def signup
77+
@foo = params[:foo]
7878
7979
mail to: "[email protected]"
8080
end
@@ -102,8 +102,9 @@ Feature: have_enqueued_mail matcher
102102
"""ruby
103103
class MyMailer < ApplicationMailer
104104
105-
def signup(user = nil)
105+
def signup(user)
106106
@user = user
107+
@foo = params[:foo]
107108
108109
mail to: "[email protected]"
109110
end
@@ -118,7 +119,7 @@ Feature: have_enqueued_mail matcher
118119
ActiveJob::Base.queue_adapter = :test
119120
# Works also with both, named parameters match first argument
120121
expect {
121-
MyMailer.with('foo' => 'bar').signup('user').deliver_later
122+
MyMailer.with(foo: 'bar').signup('user').deliver_later
122123
}.to have_enqueued_mail(MyMailer, :signup).with({foo: 'bar'}, 'user')
123124
end
124125
end

0 commit comments

Comments
 (0)