Hi – if my controller action already ensures that the correct template
is
being rendered, what use is speccing that it should also be successful?
I do it, but just because I saw someone else do it ages ago.
Is there a point?
Cheers,
Doug.
On 5 Jun 2009, at 13:36, doug livesey wrote:
Hi – if my controller action already ensures that the correct
template is being rendered, what use is speccing that it should also
be successful?
I do it, but just because I saw someone else do it ages ago.
Is there a point?
It checks that the response code indicates to the browser that the
request was 200 OK (as opposed to, say a 302 redirect, or a 404 not
found).
It’s useful when you’re doing TDD as it’s the simplest thing to expect
a controller to do. If you break something it’s also quite a nice
first-failure to have.
see HTTP/1.1: Status Code Definitions
Matt W.
http://blog.mattwynne.net
It’s useful when you’re doing TDD as it’s the simplest thing to expect
a controller to do. If you break something it’s also quite a nice
first-failure to have.
Hmm, I’m not sure about that. If the view fails to render, then Rails
returns the error page,
i.e: response.should be_success is total crap.