From bc19c0d09cd04e1862c7a8f3bb7bcaf289270df3 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 14 Jan 2013 20:05:43 +0100 Subject: test for ActiveModel::Conversion#to_partial_path and namespaced models --- activemodel/test/cases/conversion_test.rb | 4 ++++ activemodel/test/models/helicopter.rb | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'activemodel/test') 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 -- cgit v1.2.3