Rspec Test render(:nothing = true)

I was trying to test one of my controllers was successfully hitting the render(:nothing = true) block. I could not find anything specifically in the API which handled this senario, so I ended up using have_text with a space as an argument.

@response.should have_text(" ")

Posted on March 31, 2008 at 4:15 pm by doug · Permalink
In: Uncategorized · Tagged with: 

One Response

Subscribe to comments via RSS

  1. Written by John
    on August 4, 2010 at 4:05 am
    Permalink

    This might be equivalent/cleaner/better:

    response.body.should be_empty

Subscribe to comments via RSS

Leave a Reply