Gaston Ramos
2007-Jun-07 18:20 UTC
[rspec-users] Problem with response.should render_template
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. -- 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
Anthony Carlos
2007-Jun-07 18:50 UTC
[rspec-users] Problem with response.should render_template
Gaston: Just a guess, but maybe your :id => 1 should be :id => ''1'' (note the quotes)? The value that was returned looks like a description of a ruby object and its memory location (e.g., #<Spec::Mocks::Mock:0xb74a0d14>). If anyone can explain how that got in there, I''d appreciate it. I hope it helps, -Anthony On Jun 7, 2007, at 2:20 PM, Gaston Ramos 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. > > -- > 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
David Chelimsky
2007-Jun-07 18:59 UTC
[rspec-users] Problem with response.should render_template
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?> > -- > 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 >
Gastón Ramos
2007-Jun-07 19:53 UTC
[rspec-users] Problem with response.should render_template
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
Anthony Carlos
2007-Jun-07 20:31 UTC
[rspec-users] Problem with response.should render_template
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
David Chelimsky
2007-Jun-07 20:42 UTC
[rspec-users] Problem with response.should render_template
On 6/7/07, Anthony Carlos <anthony at digitalphenom.com> wrote:> 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.I think the code is fine and the spec needs to use the ids quoted (strings) as Anthony suggests earlier in this thread.> > 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 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Gaston Ramos
2007-Jun-08 13:20 UTC
[rspec-users] Problem with response.should render_template
El jue, 07 de jun de 2007, a las 03:42:39 -0500, David Chelimsky dijo:> On 6/7/07, Anthony Carlos <anthony at digitalphenom.com> wrote: > > 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. > > I think the code is fine and the spec needs to use the ids quoted > (strings) as Anthony suggests earlier in this thread.thanks, I changed the spec and it works! response.should redirect_to :action => ''show'', :id => @doc_type> > > > > 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 > > > > _______________________________________________ > > 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