everydayrails / everydayrails-rspec-2017

Sample source for the 2017 edition of Everyday Rails Testing with RSpec.
http://rspectutorial.com
312 stars 247 forks source link

Chapter 10 Why using regexp? #52

Open JunichiIto opened 6 years ago

JunichiIto commented 6 years ago

Chapter 10, page 177,

expect(mail.body).to match(/Hello #{user.first_name},/)

I am not sure why you used regexp here. I think using string is simpler:

expect(mail.body).to match "Hello #{user.first_name},"