[rspec-users] Test Rendering nothing in Rails

Shane Mingins smingins at elctech.com
Wed Aug 1 19:00:18 EDT 2007


and better:   response.body.should be_blank

On 2/08/2007, at 10:54 AM, Shane Mingins wrote:

> ok ... went with     response.body.should == " "
>
>
> On 2/08/2007, at 10:47 AM, Shane Mingins wrote:
>
>> Hi
>>
>> In a controller I have method that is accessed via an AJAX call  
>> and will conditionally do:
>>
>> render :nothing => true
>>
>> to test the condition hitting this line I was hoping to do  
>> something like:
>>
>> response.should render_template(:nothing)
>>
>> How should I test this behaviour?
>>
>> Cheers
>> Shane
>>
>
> r

Shane Mingins
ELC Technologies (TM)
PO Box 247
Santa Barbara, CA 93102

Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email:  smingins at elctech.com
AIM:     ShaneMingins
Skype: shane.mingins

(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office

+44 020 7504 1346 Tel - London Office
+44 020 7504 1347 Fax - London Office

http://www.elctech.com

--------------------------------------------------------------------
Privacy and Confidentiality Notice:
The information contained in this electronic mail message is intended  
for the named recipient(s) only. It may contain privileged and  
confidential information. If you are not an intended recipient, you
must not copy, forward, distribute or take any action in reliance on  
it. If you have received this electronic mail message in error,  
please notify the sender immediately.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070802/f7045ee0/attachment-0001.html 


More information about the rspec-users mailing list