v0.3 of Flash Helper Plugin
November 8th, 2005
A new day, a new release !
What’s changed ?
- A heinous bug was corrected that prevented flash.now from being correctly appended to.
#show_flash_messageswas always returning the enclosingdiv. Now, it will only return something if the keys contain something.- Assertions for your unit tests. See below for details.
- Renamed middle package from flash_plugin_helper to flash_helper_plugin. This should not have any impact on your code.
Test::Unit::TestCase:
#assert_any_flash_contains(string_or_regexp, msg=nil)#assert_any_flash_does_not_contain(string_or_regexp, msg=nil)#assert_failure_flash_contains(string_or_regexp, msg=nil)#assert_failure_flash_does_not_contain(string_or_regexp, msg=nil)#assert_success_flash_contains(string_or_regexp, msg=nil)#assert_success_flash_does_not_contain(string_or_regexp, msg=nil)#assert_message_flash_contains(string_or_regexp, msg=nil)#assert_message_flash_does_not_contain(string_or_regexp, msg=nil)
The any variants of the assertions check all message keys: :notice, :message and :warning. All messages are concatenated, and the assertion is made against the resulting string.
#assert_flash_contains(key, string_or_regexp, msg=nil)#assert_flash_does_not_contain(key, string_or_regexp, msg=nil)#assert_in_contents(string_or_regexp, contents, msg=nil)#assert_not_in_contents(string_or_regexp, contents, msg=nil)
And last, but not least, the #flash_contents(key) method returns the flash’s contents, as a string, whether it was an Array or a String to begin with.
If anybody is using this in production, would you drop me an E-Mail ?
Enjoy !
Leave a Reply