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_messages was always returning the enclosing div. 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.
The interesting feature in this version are the new assertions. For example, the following code: can be expressed like this instead: The reverse is also true: There are eight assertion methods added to 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.

In addition, four building block assertions are also added:
  • #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

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(4) (1) (1) (1) (1) (2) (1) (1) (1) (2) (2) (1) (2) (1) (3) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (4) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (1) (3) (1) (5) (2) (10) (10) (11) (14) (2) (1) (3) (1) (1) (1) (1) (1) (0) (1) (2) (2) (2) (1) (1) (1) (4) (1) (3) (1) (4) (2) (2) (25) (2) (1) (1) (0) (1) (1) (1) (23) (25) (1) (1) (13) (1) (1) (1) (4) (5) (1) (1) (1) (4) (1) (2) (3) (4) (4) (1) (1) (1) (8) (3) (1) (5) (5) (2) (2) (2) (4) (8) (7) (1) (1) (1) (1) (2) (4) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives