Permalink
Browse files

Merge pull request #8939 from senny/to_partial_path_test_to_prevent_r…

…egressions

test case for ActiveModel::Conversion#to_partial_path and namespaced models
  • Loading branch information...
2 parents 1dd8925 + bc19c0d commit fb9ac47c286fbdfe05263d4d0346e50892090603 @rafaelfranca rafaelfranca committed Jan 14, 2013
Showing with 8 additions and 0 deletions.
  1. +4 −0 activemodel/test/cases/conversion_test.rb
  2. +4 −0 activemodel/test/models/helicopter.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
@@ -1,3 +1,7 @@
class Helicopter
include ActiveModel::Conversion
end
+
+class Helicopter::Comanche
+ include ActiveModel::Conversion
+end

0 comments on commit fb9ac47

Please sign in to comment.