# Testing for flash.now values

**URL:** <https://www.ruby-forum.com/t/testing-for-flash-now-values/59736>\
**Category:** Rails\
**Created:** [May 5, 2006, 10:05pm UTC](https://www.ruby-forum.com/t/testing-for-flash-now-values/59736 "2006-05-05T22:05:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/35a633/32.png) [@Kian](https://www.ruby-forum.com/u/Kian)\
**Post date:** [May 5, 2006, 10:05pm UTC](https://www.ruby-forum.com/t/testing-for-flash-now-values/59736/1 "2006-05-05T22:05:12Z")

</div>

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  
.

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

---

<div class="post-metadata">

**Author:** ![Kian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/35a633/32.png) [@Kian](https://www.ruby-forum.com/u/Kian)\
**Post date:** [June 22, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/testing-for-flash-now-values/59736/2 "2006-06-22T14:38:58Z")

</div>

Did you learn anything on this? Would like to know myself.

Isak
