diff options
Diffstat (limited to 'actionpack/test/controller/flash_test.rb')
-rw-r--r-- | actionpack/test/controller/flash_test.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/actionpack/test/controller/flash_test.rb b/actionpack/test/controller/flash_test.rb index 6397407217..4e046b2fc8 100644 --- a/actionpack/test/controller/flash_test.rb +++ b/actionpack/test/controller/flash_test.rb @@ -5,7 +5,7 @@ class FlashTest < ActionController::TestCase class TestController < ActionController::Base def set_flash flash["that"] = "hello" - render :inline => "hello" + render inline: "hello" end def set_flash_now @@ -14,32 +14,32 @@ class FlashTest < ActionController::TestCase flash.now["foo"] ||= "err" @flashy = flash.now["that"] @flash_copy = {}.update flash - render :inline => "hello" + render inline: "hello" end def attempt_to_use_flash_now @flash_copy = {}.update flash @flashy = flash["that"] - render :inline => "hello" + render inline: "hello" end def use_flash @flash_copy = {}.update flash @flashy = flash["that"] - render :inline => "hello" + render inline: "hello" end def use_flash_and_keep_it @flash_copy = {}.update flash @flashy = flash["that"] flash.keep - render :inline => "hello" + render inline: "hello" end def use_flash_and_update_it flash.update("this" => "hello again") @flash_copy = {}.update flash - render :inline => "hello" + render inline: "hello" end def use_flash_after_reset_session @@ -49,7 +49,7 @@ class FlashTest < ActionController::TestCase @flashy_that_reset = flash["that"] flash["this"] = "good-bye" @flashy_this = flash["this"] - render :inline => "hello" + render inline: "hello" end # methods for test_sweep_after_halted_action_chain @@ -66,34 +66,34 @@ class FlashTest < ActionController::TestCase def halt_and_redir flash["foo"] = "bar" - redirect_to :action => "std_action" + redirect_to action: "std_action" @flash_copy = {}.update(flash) end def redirect_with_alert - redirect_to "/nowhere", :alert => "Beware the nowheres!" + redirect_to "/nowhere", alert: "Beware the nowheres!" end def redirect_with_notice - redirect_to "/somewhere", :notice => "Good luck in the somewheres!" + redirect_to "/somewhere", notice: "Good luck in the somewheres!" end def render_with_flash_now_alert flash.now.alert = "Beware the nowheres now!" - render :inline => "hello" + render inline: "hello" end def render_with_flash_now_notice flash.now.notice = "Good luck in the somewheres now!" - render :inline => "hello" + render inline: "hello" end def redirect_with_other_flashes - redirect_to "/wonderland", :flash => { :joyride => "Horses!" } + redirect_to "/wonderland", flash: { joyride: "Horses!" } end def redirect_with_foo_flash - redirect_to "/wonderland", :foo => "for great justice" + redirect_to "/wonderland", foo: "for great justice" end end @@ -172,7 +172,7 @@ class FlashTest < ActionController::TestCase def test_keep_and_discard_return_values flash = ActionDispatch::Flash::FlashHash.new - flash.update(:foo => :foo_indeed, :bar => :bar_indeed) + flash.update(foo: :foo_indeed, bar: :bar_indeed) assert_equal(:foo_indeed, flash.discard(:foo)) # valid key passed assert_nil flash.discard(:unknown) # non existent key passed @@ -256,7 +256,7 @@ class FlashIntegrationTest < ActionDispatch::IntegrationTest end def use_flash - render :inline => "flash: #{flash["that"]}" + render inline: "flash: #{flash["that"]}" end def set_bar @@ -324,12 +324,12 @@ class FlashIntegrationTest < ActionDispatch::IntegrationTest with_routing do |set| set.draw do ActiveSupport::Deprecation.silence do - get ":action", :to => FlashIntegrationTest::TestController + get ":action", to: FlashIntegrationTest::TestController end end @app = self.class.build_app(set) do |middleware| - middleware.use ActionDispatch::Session::CookieStore, :key => SessionKey + middleware.use ActionDispatch::Session::CookieStore, key: SessionKey middleware.use ActionDispatch::Flash middleware.delete ActionDispatch::ShowExceptions end |