1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Test to_model being called in ActiveModel::Naming helpers

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Ernie Miller 2010-10-04 15:04:39 -04:00 committed by José Valim
parent 33aaa15f62
commit 21cb1d40b9
2 changed files with 11 additions and 0 deletions

View file

@ -125,6 +125,10 @@ class NamingHelpersTest < Test::Unit::TestCase
@param_key = 'contact'
end
def test_to_model_called_on_record
assert_equal 'post_named_track_backs', plural(Post::TrackBack.new)
end
def test_singular
assert_equal @singular, singular(@record)
end

View file

@ -1,4 +1,11 @@
class Post
class TrackBack
def to_model
NamedTrackBack.new(self)
end
end
class NamedTrackBack
extend ActiveModel::Naming
end
end