-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`expect(response).to_eq('something') hangs if it's a redirect #667
Comments
I believe this is a duplicate of #613, which is caused by rack/rack#419. It's been fixed in rack but I don't think there's a rack release with it yet. For now, use something like |
Thanks for the report! This is a yucky issue, agreed. tldr: You want to assert on response.body, not response (which is a Rack::Response, not a String). The underlying issue is in Rack. See rack/rack#419 and previous rspec issues rspec/rspec-expectations#166 and #601 |
Good to know. Thanks for the quick response! |
In my tests,
expect(response).to_eq('something')
was hanging. I determined that this only happens when the response is a redirect.expect(response).to be_ok
fails as expected in this case.I'm guessing that
to_eq
is trying to look at the response body, and since a redirect doesn't have one, it hangs? Could it be patched to fail instead, saying that it expected 'something' and got nil?The text was updated successfully, but these errors were encountered: