Ruby on Rails
Saturday, July 15, 2017
Very close!
Thank you so much! Your suggestion gave me a whole new understanding of Rspec
Ralph
On Saturday, July 15, 2017 at 7:48:49 PM UTC-6, Dave Aronson wrote:
-- expect([200, 302]).to include response.status
Thank you so much! Your suggestion gave me a whole new understanding of Rspec
Ralph
On Saturday, July 15, 2017 at 7:48:49 PM UTC-6, Dave Aronson wrote:
On Saturday, July 15, 2017, Ralph Shnelvar <ralphs@dos32.com> wrote:I've triedexpect(response).to (have_
http_status(200) || have_http_ status(302))
While syntactically valid, this doesn't work becausehave_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/62013409-cdce-4088-a4f0-bba5d2b51406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment