instiki/vendor/rails/activesupport/test/core_ext/module/model_naming_test.rb
Jacques Distler 664552ac02 Rails 2.3.3.1
Update to latest Rails.
A little bit of jiggery-pokery is involved, since they
neglected to re-include vendored Rack in this release.
2009-08-04 10:16:03 -05:00

28 lines
593 B
Ruby

require 'abstract_unit'
class ModelNamingTest < Test::Unit::TestCase
def setup
@model_name = ActiveSupport::ModelName.new('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