small medium large xlarge

26 Dec 2010, 15:39
Doug Puchalski (4 posts)

From page 176 of b10.0, the following line:

should "be successful" { assert_response :success }

Doesn’t appear to be valid ruby syntax to me. I have to change it to

should "be successful"; do assert_response :success end

Am I missing something?

02 Jan 2011, 16:30
Noel Rappin (48 posts)

Sorry for not getting to this sooner, I was away.

I need to poke at this a little bit, this may be a mistake on my part in trying to get the example to take up fewer line. I think that the proper way to rewrite this as a one-liner is:

should(“be successful”) { assert_response :success }

Or use the shoulda macro:

should respond_with(:success)



You must be logged in to comment