Testing - how to get access to an instance variable

inside controller

def foo
@city = City.find(@params[:id])
@city.bar = 1234
end

While writing functional tests how do I ensure that the @city.bar is
1234?

def test_edit
get :edit, :id => 1
assert_not_nil assigns(:city)
#?? how to assert that city.bar is 1234
end

Thanks

Neeraj K. wrote:

While writing functional tests how do I ensure that the @city.bar is
1234?

def test_edit
get :edit, :id => 1
assert_not_nil assigns(:city)
assert_equal 1234, assigns(‘city’).bar
end

And in general Peak Obsession is very
helpful :slight_smile:

Cheers,
Łukasz Piestrzeniewicz

thanks