diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-01-14 20:05:43 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-01-14 21:17:22 +0100 |
commit | bc19c0d09cd04e1862c7a8f3bb7bcaf289270df3 (patch) | |
tree | a760790b8f3bb6d5a9439d12075d595c2b32673a /activemodel | |
parent | bf095770e561c51cebeb5a556afc03a21d9e603c (diff) | |
download | rails-bc19c0d09cd04e1862c7a8f3bb7bcaf289270df3.tar.gz rails-bc19c0d09cd04e1862c7a8f3bb7bcaf289270df3.tar.bz2 rails-bc19c0d09cd04e1862c7a8f3bb7bcaf289270df3.zip |
test for ActiveModel::Conversion#to_partial_path and namespaced models
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/test/cases/conversion_test.rb | 4 | ||||
-rw-r--r-- | activemodel/test/models/helicopter.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/activemodel/test/cases/conversion_test.rb b/activemodel/test/cases/conversion_test.rb index d679ad41aa..a037666cbc 100644 --- a/activemodel/test/cases/conversion_test.rb +++ b/activemodel/test/cases/conversion_test.rb @@ -29,4 +29,8 @@ class ConversionTest < ActiveModel::TestCase assert_equal "helicopters/helicopter", Helicopter.new.to_partial_path, "ActiveModel::Conversion#to_partial_path caching should be class-specific" end + + test "to_partial_path handles namespaced models" do + assert_equal "helicopter/comanches/comanche", Helicopter::Comanche.new.to_partial_path + end end diff --git a/activemodel/test/models/helicopter.rb b/activemodel/test/models/helicopter.rb index a52b6fb4dd..933f3c463a 100644 --- a/activemodel/test/models/helicopter.rb +++ b/activemodel/test/models/helicopter.rb @@ -1,3 +1,7 @@ class Helicopter include ActiveModel::Conversion end + +class Helicopter::Comanche + include ActiveModel::Conversion +end |