Skip to content

Commit b22a08b

Browse files
committed
Fix cucumber scenarios
1 parent 6fd11ab commit b22a08b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

features/matchers/have_enqueued_mail_matcher.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Feature: have_enqueued_mail matcher
6868
When I run `rspec spec/mailers/my_mailer_spec.rb`
6969
Then the examples should all pass
7070

71+
@rails_post_6
7172
Scenario: Parameterize the mailer
7273
Given a file named "app/mailers/my_mailer.rb" with:
7374
"""ruby
@@ -90,13 +91,14 @@ Feature: have_enqueued_mail matcher
9091
# Works with named parameters
9192
expect {
9293
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'}))
9495
end
9596
end
9697
"""
9798
When I run `rspec spec/mailers/my_mailer_spec.rb`
9899
Then the examples should all pass
99100

101+
@rails_post_6
100102
Scenario: Parameterize and pass an argument to the mailer
101103
Given a file named "app/mailers/my_mailer.rb" with:
102104
"""ruby
@@ -120,7 +122,7 @@ Feature: have_enqueued_mail matcher
120122
# Works also with both, named parameters match first argument
121123
expect {
122124
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'])
124126
end
125127
end
126128
"""

0 commit comments

Comments
 (0)