class FlashTest::TestController

Public Instance Methods

attempt_to_use_flash_now() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 22
def attempt_to_use_flash_now
  @flash_copy = {}.update flash
  @flashy = flash["that"]
  render inline: "hello"
end
filter_halting_action() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 65
def filter_halting_action
  @flash_copy = {}.update(flash)
end
halt_and_redir() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 69
def halt_and_redir
  flash["foo"] = "bar"
  redirect_to action: "std_action"
  @flash_copy = {}.update(flash)
end
redirect_with_alert() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 75
def redirect_with_alert
  redirect_to "/nowhere", alert: "Beware the nowheres!"
end
redirect_with_foo_flash() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 97
def redirect_with_foo_flash
  redirect_to "/wonderland", foo: "for great justice"
end
redirect_with_notice() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 79
def redirect_with_notice
  redirect_to "/somewhere", notice: "Good luck in the somewheres!"
end
redirect_with_other_flashes() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 93
def redirect_with_other_flashes
  redirect_to "/wonderland", flash: { joyride: "Horses!" }
end
render_with_flash_now_alert() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 83
def render_with_flash_now_alert
  flash.now.alert = "Beware the nowheres now!"
  render inline: "hello"
end
render_with_flash_now_notice() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 88
def render_with_flash_now_notice
  flash.now.notice = "Good luck in the somewheres now!"
  render inline: "hello"
end
set_flash() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 8
def set_flash
  flash["that"] = "hello"
  render inline: "hello"
end
set_flash_now() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 13
def set_flash_now
  flash.now["that"] = "hello"
  flash.now["foo"] ||= "bar"
  flash.now["foo"] ||= "err"
  @flashy = flash.now["that"]
  @flash_copy = {}.update flash
  render inline: "hello"
end
std_action() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 60
def std_action
  @flash_copy = {}.update(flash)
  head :ok
end
use_flash() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 28
def use_flash
  @flash_copy = {}.update flash
  @flashy = flash["that"]
  render inline: "hello"
end
use_flash_after_reset_session() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 47
def use_flash_after_reset_session
  flash["that"] = "hello"
  @flashy_that = flash["that"]
  reset_session
  @flashy_that_reset = flash["that"]
  flash["this"] = "good-bye"
  @flashy_this = flash["this"]
  render inline: "hello"
end
use_flash_and_keep_it() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 34
def use_flash_and_keep_it
  @flash_copy = {}.update flash
  @flashy = flash["that"]
  flash.keep
  render inline: "hello"
end
use_flash_and_update_it() click to toggle source
# File actionpack/test/controller/flash_test.rb, line 41
def use_flash_and_update_it
  flash.update("this" => "hello again")
  @flash_copy = {}.update flash
  render inline: "hello"
end