2009/4/23 dwayne <[email protected]>:
> 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>

Como estás usando el should_set_the_flash_to? La macro debe ir a nivel
del context. O sea así:

  context "blablabla" do
    setup { get :index }
    should_set_the_flash_to('Hola')
  end

Y no así:

  context "blablabla" do
    setup { get :index }
    should "set the flash" do
      should_set_the_flash_to('Hola')
    end
  end

Saludos,
Matías A. Flores
http://matflores.com
http://twitter.com/matflores
_______________________________________________
Ruby mailing list
[email protected]
http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar

Responder a