aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/base_test.rb
diff options
context:
space:
mode:
authorTarmo Tänav <tarmo@itech.ee>2008-08-23 17:40:16 +0300
committerTarmo Tänav <tarmo@itech.ee>2008-08-23 17:43:52 +0300
commitb5c4c7daf8e26e829ec4d7ece91f622d9e1a49fa (patch)
treed51a029ae62a2ac097e366f45d44f5aedf2ea385 /activeresource/test/base_test.rb
parente48e77e0222292176cd9f68658dd54524f582d9b (diff)
downloadrails-b5c4c7daf8e26e829ec4d7ece91f622d9e1a49fa.tar.gz
rails-b5c4c7daf8e26e829ec4d7ece91f622d9e1a49fa.tar.bz2
rails-b5c4c7daf8e26e829ec4d7ece91f622d9e1a49fa.zip
Clear prefix_parameters cache when setting prefix
Diffstat (limited to 'activeresource/test/base_test.rb')
-rw-r--r--activeresource/test/base_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb
index 0d997b2a2f..9a0789e0b4 100644
--- a/activeresource/test/base_test.rb
+++ b/activeresource/test/base_test.rb
@@ -485,6 +485,15 @@ class BaseTest < Test::Unit::TestCase
end
end
+ def test_set_prefix_twice_should_clear_params
+ SetterTrap.rollback_sets(Person) do |person_class|
+ person_class.prefix = "the_prefix/:the_param1"
+ assert_equal Set.new([:the_param1]), person_class.prefix_parameters
+ person_class.prefix = "the_prefix/:the_param2"
+ assert_equal Set.new([:the_param2]), person_class.prefix_parameters
+ end
+ end
+
def test_set_prefix_with_default_value
SetterTrap.rollback_sets(Person) do |person_class|
person_class.set_prefix