@@ -68,6 +68,7 @@ Feature: have_enqueued_mail matcher
68
68
When I run `rspec spec/mailers/my_mailer_spec.rb`
69
69
Then the examples should all pass
70
70
71
+ @rails_post_6
71
72
Scenario : Parameterize the mailer
72
73
Given a file named "app/mailers/my_mailer.rb" with:
73
74
"""ruby
@@ -90,13 +91,14 @@ Feature: have_enqueued_mail matcher
90
91
# Works with named parameters
91
92
expect {
92
93
MyMailer.with(foo: 'bar').signup.deliver_later
93
- }.to have_enqueued_mail(MyMailer, :signup).with(foo: 'bar')
94
+ }.to have_enqueued_mail(MyMailer, :signup).with(a_hash_including(params: { foo: 'bar'}) )
94
95
end
95
96
end
96
97
"""
97
98
When I run `rspec spec/mailers/my_mailer_spec.rb`
98
99
Then the examples should all pass
99
100
101
+ @rails_post_6
100
102
Scenario : Parameterize and pass an argument to the mailer
101
103
Given a file named "app/mailers/my_mailer.rb" with:
102
104
"""ruby
@@ -120,7 +122,7 @@ Feature: have_enqueued_mail matcher
120
122
# Works also with both, named parameters match first argument
121
123
expect {
122
124
MyMailer.with(foo: 'bar').signup('user').deliver_later
123
- }.to have_enqueued_mail(MyMailer, :signup).with({foo: 'bar'}, 'user')
125
+ }.to have_enqueued_mail(MyMailer, :signup).with(params: {foo: 'bar'}, args: [ 'user'] )
124
126
end
125
127
end
126
128
"""
0 commit comments