aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/callback_inheritance_test.rb
diff options
context:
space:
mode:
authorBogdan Gusiev <agresso@gmail.com>2012-02-04 13:31:00 +0200
committerBogdan Gusiev <agresso@gmail.com>2012-02-04 13:31:00 +0200
commit4f53091dd199915e0605e8202e7534c0edcaf3fa (patch)
tree7c60b3f3d08527f529ef8b05b4c24f07b0e7b227 /activesupport/test/callback_inheritance_test.rb
parentb41ef0a448c025f1f2eef33c28ea565e38491f5c (diff)
downloadrails-4f53091dd199915e0605e8202e7534c0edcaf3fa.tar.gz
rails-4f53091dd199915e0605e8202e7534c0edcaf3fa.tar.bz2
rails-4f53091dd199915e0605e8202e7534c0edcaf3fa.zip
AS::Callbacks: rip out per_key option.
Diffstat (limited to 'activesupport/test/callback_inheritance_test.rb')
-rw-r--r--activesupport/test/callback_inheritance_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activesupport/test/callback_inheritance_test.rb b/activesupport/test/callback_inheritance_test.rb
index b5ad34c204..e5ac9511df 100644
--- a/activesupport/test/callback_inheritance_test.rb
+++ b/activesupport/test/callback_inheritance_test.rb
@@ -9,8 +9,8 @@ class GrandParent
end
define_callbacks :dispatch
- set_callback :dispatch, :before, :before1, :before2, :per_key => {:if => proc {|c| c.action_name == "index" || c.action_name == "update" }}
- set_callback :dispatch, :after, :after1, :after2, :per_key => {:if => proc {|c| c.action_name == "update" || c.action_name == "delete" }}
+ set_callback :dispatch, :before, :before1, :before2, :if => proc {|c| c.action_name == "index" || c.action_name == "update" }
+ set_callback :dispatch, :after, :after1, :after2, :if => proc {|c| c.action_name == "update" || c.action_name == "delete" }
def before1
@log << "before1"
@@ -37,12 +37,12 @@ class GrandParent
end
class Parent < GrandParent
- skip_callback :dispatch, :before, :before2, :per_key => {:unless => proc {|c| c.action_name == "update" }}
- skip_callback :dispatch, :after, :after2, :per_key => {:unless => proc {|c| c.action_name == "delete" }}
+ skip_callback :dispatch, :before, :before2, :unless => proc {|c| c.action_name == "update" }
+ skip_callback :dispatch, :after, :after2, :unless => proc {|c| c.action_name == "delete" }
end
class Child < GrandParent
- skip_callback :dispatch, :before, :before2, :per_key => {:unless => proc {|c| c.action_name == "update" }}, :if => :state_open?
+ skip_callback :dispatch, :before, :before2, :unless => proc {|c| c.action_name == "update" }, :if => :state_open?
def state_open?
@state == :open
@@ -112,15 +112,15 @@ class BasicCallbacksTest < ActiveSupport::TestCase
@unknown = GrandParent.new("unknown").dispatch
end
- def test_basic_per_key1
+ def test_basic_conditional_callback1
assert_equal %w(before1 before2 index), @index.log
end
- def test_basic_per_key2
+ def test_basic_conditional_callback2
assert_equal %w(before1 before2 update after2 after1), @update.log
end
- def test_basic_per_key3
+ def test_basic_conditional_callback3
assert_equal %w(delete after2 after1), @delete.log
end
end