[rspec-users] Problem with response.should render_template

Anthony Carlos anthony at digitalphenom.com
Thu Jun 7 16:31:48 EDT 2007


Gaston:

It looks like on line 42 you're passing :id => @doc_type. I've heard  
that that is the proper way to pass around ids. However, in this  
case, it looks like ActiveRecord is passing the entire object, not  
just the id. You could try replacing @doc_type with @doc_type.id.

If it does work, I don't know why ActiveRecord is messing up.

Let us know if it works.

-Anthony

On Jun 7, 2007, at 3:53 PM, Gastón Ramos wrote:

> El jue, 07 de jun de 2007, a las 01:59:01 -0500, David Chelimsky dijo:
>> On 6/7/07, Gaston Ramos <gramos at rectorado.unl.edu.ar> wrote:
>>> Hello, I have problems with this spec controllers:
>>>
>>> http://pastie.caboo.se/68634
>>>
>>> when I run:
>>>  rake spec:controllers
>>>
>>> I get this error:
>>>
>>> ...............F......
>>>
>>> 1)
>>> 'DocTypeController  should update and redirect to show' FAILED
>>> expected redirect to {:action=>"show", :id=>1}, got redirect to
>>> "http://test.host/doc_type/show/%23%3CSpec%3A%3AMocks%3A%3AMock% 
>>> 3A0xb74a0d14%3E"
>>> ./spec/controllers/doc_type_controller_spec.rb:63:
>>>
>>> Finished in 0.386261 seconds
>>>
>>> 22 examples, 1 failure
>>>
>>> I would appreciate any help.
>>
>> Can you please add the controller code to the pastie?
>
>
> http://pastie.caboo.se/68657
>
>>
>>>
>>> --
>>> Gastón Ramos
>>>
>>> "I always thought Smalltalk would beat Java, I just didn't know  
>>> it would be
>>> called 'Ruby' when it did."
>>>  -- Kent Beck
>>> _______________________________________________
>>> rspec-users mailing list
>>> rspec-users at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/rspec-users
>>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
>
> -- 
> Gastón Ramos
>
> "I always thought Smalltalk would beat Java, I just didn't know it  
> would be
> called 'Ruby' when it did."
>  -- Kent Beck
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list