This project is archived and is in readonly mode.
flash.use should return values which it marked as (un)used
-
Niels Ganser
Here's an alternative, i.e. more extensive, test:
def test_keep_and_discard_return_values flash = ActionController::Flash::FlashHash.new flash.update(:foo => :foo_indeed, :bar => :bar_indeed) [:discard, :keep].each do |method| assert_equal(:foo_indeed, flash.send(method, :foo)) # valid key passed assert_nil flash.send(method, :unknown) # non existant key passed assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.send(method)) # nothing passed assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.send(method, nil)) # nothing passed end end -
Niels Ganser
Right.. Sorry for the soliloquy. Please review the attached updated patch which features more extensive tests.
I wonder if the test should go someplace else though as it doesn't really fit in with the rest of the file. Any thoughts on this?
-
Pratik
- Assigned user set to josh
-
josh
- State changed from new to open
- Milestone cleared.
-
Repository
- State changed from open to resolved
(from [bb8e5843f32b13e759da51a4713a31b23ebcac6d]) ActionController::Flash::FlashHash.use now returns either the value corresponding to the passed key or itself when no key is passed [#1792 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/bb8e5843f32b13e759da51a4713a31... -
Repository
(from [c01014ac1c98a05fe68e652f978dfa9d43f0fc2b]) Modify the behavior of
radio_button_tagto usesanitize_to_idfor consistency [#1792 status:resolved]Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/c01014ac1c98a05fe68e652f978dfa...
