I have a webpage with two different strings depending on time of the day - "Good day" or "Good night".
Is there any way to do some sort of assert_content(my_string) that check if one of the two given strings is present?
It doesn't matter which one is present, just that one is.
If using MiniTest then you can use assert_match:
assert_match /Good day|Good night/, string
If using RSpec then you can use match:
expect(string).to match /Good day|Good night/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With