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
should render and should redirect_to are both passing #241
Comments
Request specs wrap Rails' integration tests, which apparently preserve the full list of what was rendered. I agree each request should probably clear out that list, but that would have to be managed in Rails (the rspec matchers delegate directly to Rails' assertions), so you'd need to report this to the Rails tracker to get it addressed. That said, this probably hasn't come up before because most folks (myself included) envision request specs as more white-box than black-box, focusing expectations on content rather than low-level details like which template is rendered. Those details are better suited for controller specs, which wrap Rails' functional tests, which only support one request per example. |
Thanks. All that makes sense. I can report the issue to rails if somebody would help me to translate the specs above into the rails tests. I am very new to rails unfortunately. |
|
Thanks. Submitted to Rails. |
Fixed here: http://github.com/rails/rails/commit/f7573175de7c584ee9c256fb567311adc2de04b9 (master) |
Thanks a lot. That was quick. |
Srsly. Well done. Cheers. |
With the controller:
and the request spec:
The spec is passing (it checks logically opposite results).
The reason is that there are 2 requests (get and post). Obviously the result of
post
preserves the result of the previousget
.I might be missing something, but I suppose it should not be the case in integration test - each response/request should not be in any way related to the others (except the session and cookies).
I also might be doing something wrong of course :)
Using rspec 2.0.0.
The text was updated successfully, but these errors were encountered: