> Cómo hay para chekear si el controller le asignó un valor determinado a una
> variable instance variable.
>
> Uso Test::Unit y Shoulda

Una opción es usar assigns como te indicaron. Pero si usás Shoulda
también tenés la opción de usar la macro should_assign_to. Ej:

  context "on GET to :show" do
    setup { get :show, :id => "1" }
    should_assign_to :post
  end

Este test pasaría solo si en show le asignás algo a @post (cualquier
cosa != nil).

También podés chequear que lo que asignás sea una instancia de una
clase determinada:

    should_assign_to :post, :class => Post

O chequear directamente si a @post se le asignó un valor determinado:

    should_assign_to(:post) { @first_post }

Saludos,
Matías

>
> tante gratzie
>
> _______________________________________________
> 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