[rspec-users] Testing update, flash[:error]

Paul Nelligan nellboy at gmail.com
Mon Nov 22 10:04:46 EST 2010


Hi Andrew

I suspect that flash[:error] is not a valid identifier,  and therefore is
returning a nil value.

Hope this is of use to you.

Paul

On Mon, Nov 22, 2010 at 2:00 PM, Andrew Davis <lists at ruby-forum.com> wrote:

> Hello everyone,
>
> I'm trying to write a failure test for updating a model, but the
> flash[:error] seems to be causing a problem.
>
> All code can be found here:
> http://pastie.org/private/zcu0fpzbfbjbleocmf1bqw
>
> I've also tried using regular expressions, instead of:
>
> flash[:error].should == "Name can't be blank"
>
> I've tried:
>
> flash[:error].should =~ /Name can't be blank/i
>
> Thank you in advance!!
> Andrew Davis
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20101122/82f171a3/attachment.html>


More information about the rspec-users mailing list