Is there any way in a functional test to get the value of the flash hash if the value was set using flash.now? It doesn''t appear to be visible in flash in the test. Example: Controller: def index flash.now[''notice''] = ''this is the index'' end Functional Test: def test_index_flash get :index assert_equal ''this is the index'', flash[''notice''] end This will fail with the message: <"this is the index"> expected but was <nil>. Any ideas? I''ve seen this come up in the mailing lists before, but can''t seem to find an answer or workaround. Or maybe just an explanation -- why does this happen? Thx
Did you learn anything on this? Would like to know myself. Isak On 5/5/06, Kian <kianwright@pfima.com> wrote:> Is there any way in a functional test to get the value of the flash hash > if the value was set using flash.now? It doesn''t appear to be visible in > flash in the test. Example: > > Controller: > > def index > flash.now[''notice''] = ''this is the index'' > end > > Functional Test: > > def test_index_flash > get :index > assert_equal ''this is the index'', flash[''notice''] > end > > This will fail with the message: > <"this is the index"> expected but was > <nil>. > > Any ideas? I''ve seen this come up in the mailing lists before, > but can''t seem to find an answer or workaround. Or maybe just > an explanation -- why does this happen? > > Thx > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails >