Namespace
Methods
- T
-
- test_does_not_set_the_session_if_the_flash_is_empty,
- test_flash,
- test_flash_after_reset_session,
- test_flash_now,
- test_keep_and_discard_return_values,
- test_keep_flash,
- test_redirect_to_with_alert,
- test_redirect_to_with_notice,
- test_redirect_to_with_other_flashes,
- test_render_with_flash_now_alert,
- test_render_with_flash_now_notice,
- test_sweep_after_halted_filter_chain,
- test_update_flash
Instance Public methods
test_does_not_set_the_session_if_the_flash_is_empty()
Link
test_flash()
Link
test_flash_after_reset_session()
Link
test_flash_now()
Link
# File actionpack/test/controller/flash_test.rb, line 126 def test_flash_now get :set_flash_now assert_equal "hello", assigns["flash_copy"]["that"] assert_equal "bar" , assigns["flash_copy"]["foo"] assert_equal "hello", assigns["flashy"] get :attempt_to_use_flash_now assert_nil assigns["flash_copy"]["that"] assert_nil assigns["flash_copy"]["foo"] assert_nil assigns["flashy"] end
test_keep_and_discard_return_values()
Link
# File actionpack/test/controller/flash_test.rb, line 171 def test_keep_and_discard_return_values flash = ActionDispatch::Flash::FlashHash.new flash.update(:foo => :foo_indeed, :bar => :bar_indeed) assert_equal(:foo_indeed, flash.discard(:foo)) # valid key passed assert_nil flash.discard(:unknown) # non existant key passed assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.discard().to_hash) # nothing passed assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.discard(nil).to_hash) # nothing passed assert_equal(:foo_indeed, flash.keep(:foo)) # valid key passed assert_nil flash.keep(:unknown) # non existant key passed assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.keep().to_hash) # nothing passed assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.keep(nil).to_hash) # nothing passed end
test_keep_flash()
Link
# File actionpack/test/controller/flash_test.rb, line 112 def test_keep_flash get :set_flash get :use_flash_and_keep_it assert_equal "hello", assigns["flash_copy"]["that"] assert_equal "hello", assigns["flashy"] get :use_flash assert_equal "hello", assigns["flash_copy"]["that"], "On second flash" get :use_flash assert_nil assigns["flash_copy"]["that"], "On third flash" end
test_redirect_to_with_alert()
Link
test_redirect_to_with_notice()
Link
test_redirect_to_with_other_flashes()
Link
test_render_with_flash_now_alert()
Link
test_render_with_flash_now_notice()
Link
test_sweep_after_halted_filter_chain()
Link
# File actionpack/test/controller/flash_test.rb, line 160 def test_sweep_after_halted_filter_chain get :std_action assert_nil assigns["flash_copy"]["foo"] get :filter_halting_action assert_equal "bar", assigns["flash_copy"]["foo"] get :std_action # follow redirection assert_equal "bar", assigns["flash_copy"]["foo"] get :std_action assert_nil assigns["flash_copy"]["foo"] end
test_update_flash()
Link
# File actionpack/test/controller/flash_test.rb, line 138 def test_update_flash get :set_flash get :use_flash_and_update_it assert_equal "hello", assigns["flash_copy"]["that"] assert_equal "hello again", assigns["flash_copy"]["this"] get :use_flash assert_nil assigns["flash_copy"]["that"], "On second flash" assert_equal "hello again", assigns["flash_copy"]["this"], "On second flash" end