Permalink
Browse files

test for ActiveModel::Conversion#to_partial_path and namespaced models

  • Loading branch information...
1 parent bf09577 commit bc19c0d09cd04e1862c7a8f3bb7bcaf289270df3 @senny senny 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 bc19c0d

Please sign in to comment.