Upgrade to Rails 2.0.2
Upgraded to Rails 2.0.2, except that we maintain vendor/rails/actionpack/lib/action_controller/routing.rb from Rail 1.2.6 (at least for now), so that Routes don't change. We still get to enjoy Rails's many new features. Also fixed a bug in Chunk-handling: disable WikiWord processing in tags (for real this time).
This commit is contained in:
parent
0f6889e09f
commit
6873fc8026
1083 changed files with 52810 additions and 41058 deletions
|
@ -31,7 +31,13 @@ class FlashTest < Test::Unit::TestCase
|
|||
def use_flash_and_keep_it
|
||||
@flash_copy = {}.update flash
|
||||
@flashy = flash["that"]
|
||||
silence_warnings { keep_flash }
|
||||
flash.keep
|
||||
render :inline => "hello"
|
||||
end
|
||||
|
||||
def use_flash_and_update_it
|
||||
flash.update("this" => "hello again")
|
||||
@flash_copy = {}.update flash
|
||||
render :inline => "hello"
|
||||
end
|
||||
|
||||
|
@ -48,6 +54,23 @@ class FlashTest < Test::Unit::TestCase
|
|||
def rescue_action(e)
|
||||
raise unless ActionController::MissingTemplate === e
|
||||
end
|
||||
|
||||
# methods for test_sweep_after_halted_filter_chain
|
||||
before_filter :halt_and_redir, :only => "filter_halting_action"
|
||||
|
||||
def std_action
|
||||
@flash_copy = {}.update(flash)
|
||||
end
|
||||
|
||||
def filter_halting_action
|
||||
@flash_copy = {}.update(flash)
|
||||
end
|
||||
|
||||
def halt_and_redir
|
||||
flash["foo"] = "bar"
|
||||
redirect_to :action => "std_action"
|
||||
@flash_copy = {}.update(flash)
|
||||
end
|
||||
end
|
||||
|
||||
def setup
|
||||
|
@ -70,7 +93,7 @@ class FlashTest < Test::Unit::TestCase
|
|||
def test_keep_flash
|
||||
get :set_flash
|
||||
|
||||
assert_deprecated(/keep_flash/) { get :use_flash_and_keep_it }
|
||||
get :use_flash_and_keep_it
|
||||
assert_equal "hello", @response.template.assigns["flash_copy"]["that"]
|
||||
assert_equal "hello", @response.template.assigns["flashy"]
|
||||
|
||||
|
@ -93,10 +116,31 @@ class FlashTest < Test::Unit::TestCase
|
|||
assert_nil @response.template.assigns["flashy"]
|
||||
end
|
||||
|
||||
def test_update_flash
|
||||
get :set_flash
|
||||
get :use_flash_and_update_it
|
||||
assert_equal "hello", @response.template.assigns["flash_copy"]["that"]
|
||||
assert_equal "hello again", @response.template.assigns["flash_copy"]["this"]
|
||||
get :use_flash
|
||||
assert_nil @response.template.assigns["flash_copy"]["that"], "On second flash"
|
||||
assert_equal "hello again", @response.template.assigns["flash_copy"]["this"], "On second flash"
|
||||
end
|
||||
|
||||
def test_flash_after_reset_session
|
||||
get :use_flash_after_reset_session
|
||||
assert_equal "hello", @response.template.assigns["flashy_that"]
|
||||
assert_equal "good-bye", @response.template.assigns["flashy_this"]
|
||||
assert_nil @response.template.assigns["flashy_that_reset"]
|
||||
end
|
||||
|
||||
def test_sweep_after_halted_filter_chain
|
||||
get :std_action
|
||||
assert_nil @response.template.assigns["flash_copy"]["foo"]
|
||||
get :filter_halting_action
|
||||
assert_equal "bar", @response.template.assigns["flash_copy"]["foo"]
|
||||
get :std_action # follow redirection
|
||||
assert_equal "bar", @response.template.assigns["flash_copy"]["foo"]
|
||||
get :std_action
|
||||
assert_nil @response.template.assigns["flash_copy"]["foo"]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue