Ruby on Rails Saturday, July 15, 2017

On Saturday, July 15, 2017, Ralph Shnelvar <ralphs@dos32.com> wrote:


I've tried
expect(response).to (have_http_status(200) || have_http_status(302))

While syntactically valid, this doesn't work because have_http_status(200)will throw an exception before it gets to the have_http_status(302) .

Maybe something like "expect([200, 302]).to include response.status_code"?  (Not sure of exact syntax as I've been away from RSpec for a while and am not at my coding computer.)


--
Sent from Gmail Mobile; please excuse top posting, typos, etc. :-(

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQigAzomwfbVea6JRKACDJgxXs0ozxd8W76%3D9%2BkcG4fO2Mg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment