aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-14 12:19:05 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-14 12:19:05 -0800
commitfb9ac47c286fbdfe05263d4d0346e50892090603 (patch)
tree85e3683e7265d86bbf1b1f400b33c39f61736176
parent1dd89250d12aba01d605af270201371e5cec89a4 (diff)
parentbc19c0d09cd04e1862c7a8f3bb7bcaf289270df3 (diff)
downloadrails-fb9ac47c286fbdfe05263d4d0346e50892090603.tar.gz
rails-fb9ac47c286fbdfe05263d4d0346e50892090603.tar.bz2
rails-fb9ac47c286fbdfe05263d4d0346e50892090603.zip
Merge pull request #8939 from senny/to_partial_path_test_to_prevent_regressions
test case for ActiveModel::Conversion#to_partial_path and namespaced models
-rw-r--r--activemodel/test/cases/conversion_test.rb4
-rw-r--r--activemodel/test/models/helicopter.rb4
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