[rspec-users] Test Rendering nothing in Rails
Edward Ocampo-Gooding
edward.og at gmail.com
Thu Aug 2 09:02:16 EDT 2007
Hi Shane,
(I'll continue with the top-posting, but I think it should be discouraged.)
As David just mentioned to me in the response to a related question, you
might want to check out
@controller.expects_render
which is now available in rspec trunk. While the response.body.should
be_empty kind of thing makes sense, it'd be nice to have a render
expectation too.
Edward
Shane Mingins wrote:
> 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 <mailto: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.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list