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

27 lines
587 B
Ruby

require 'cases/helper'
class NamingTest < ActiveModel::TestCase
def setup
@model_name = ActiveModel::Name.new(self, 'Post::TrackBack')
end
def test_singular
assert_equal 'post_track_back', @model_name.singular
end
def test_plural
assert_equal 'post_track_backs', @model_name.plural
end
def test_element
assert_equal 'track_back', @model_name.element
end
def test_collection
assert_equal 'post/track_backs', @model_name.collection
end
def test_partial_path
assert_equal 'post/track_backs/track_back', @model_name.partial_path
end
end