Gracias!
Lo puse dentro de un context y va perfecto.
------
Dwayne Macgowan
www.dwayne.com.ar


2009/4/24 Diego Algorta <[email protected]>

> On Thu, Apr 23, 2009 at 8:45 PM, dwayne <[email protected]> wrote:
> > Hola
> > Estoy tratando de usar las macros de shoulda
> > x ej:
> > should_redirect_to
> > should_set_the_flash_to
> > etc
> > y no logro hacerlas funcionar.
> > Seguí el proceso normal de instalación:
> >
> > en environment.rb
> >   config.gem 'thoughtbot-shoulda', :source  => "http://gems.github.com";,
> > :lib => 'shoulda',
> >                                    :version => '>= 2.0.6', :environment
> =>
> > :test
> > luego
> >   sudo rake gems:install
> >   sudo rake gems:unpack
> >
> > pero cuando corro los testeos recibo:
> >
> >   1) Error:
> >    test_create_without_plan(TicketsControllerTest):
> >    NoMethodError: undefined method `should_set_the_flash_to' for
> > #<TicketsControllerTest:0xb5f6b6c4>
> >
> >
> /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in
> > `method_missing'
> >       test/functional/tickets_controller_test.rb:35:in
> > `test_create_without_plan'
> >
> >
> /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/testing/setup_and_teardown.rb:94:in
> > `__send__'
> >
> >
> /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/testing/setup_and_teardown.rb:94:in
> > `run'
> >
> >
> > Alguien tuvo problemas de este tipo?
>
> Yo estoy usando shoulda en rails 2.2.2 sin problemas. Además de
> declarar la dependencia en config/environments/test.rb con config.gem,
> tengo un require 'shoulda' en el test/test_helper.rb
>
> Y con eso anda.
>
> Lo de pasar el :environment => :test 99% seguro que es ignorado y te
> está requiriendo la gema en todos los environments.
>
> Diego
> _______________________________________________
> Ruby mailing list
> [email protected]
> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>
_______________________________________________
Ruby mailing list
[email protected]
http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar

Responder a