Methods
S
T
Instance Public methods
setup()
# File activemodel/test/cases/naming_test.rb, line 214
def setup
  @klass  = Contact
  @record = @klass.new
  @singular = 'contact'
  @plural = 'contacts'
  @uncountable = Sheep
  @singular_route_key = 'contact'
  @route_key = 'contacts'
  @param_key = 'contact'
end
test_param_key()
# File activemodel/test/cases/naming_test.rb, line 255
def test_param_key
  assert_equal @param_key, param_key(@record)
end
test_param_key_for_class()
# File activemodel/test/cases/naming_test.rb, line 259
def test_param_key_for_class
  assert_equal @param_key, param_key(@klass)
end
test_plural()
# File activemodel/test/cases/naming_test.rb, line 237
def test_plural
  assert_equal @plural, plural(@record)
end
test_plural_for_class()
# File activemodel/test/cases/naming_test.rb, line 241
def test_plural_for_class
  assert_equal @plural, plural(@klass)
end
test_route_key()
# File activemodel/test/cases/naming_test.rb, line 245
def test_route_key
  assert_equal @route_key, route_key(@record)
  assert_equal @singular_route_key, singular_route_key(@record)
end
test_route_key_for_class()
# File activemodel/test/cases/naming_test.rb, line 250
def test_route_key_for_class
  assert_equal @route_key, route_key(@klass)
  assert_equal @singular_route_key, singular_route_key(@klass)
end
test_singular()
# File activemodel/test/cases/naming_test.rb, line 229
def test_singular
  assert_equal @singular, singular(@record)
end
test_singular_for_class()
# File activemodel/test/cases/naming_test.rb, line 233
def test_singular_for_class
  assert_equal @singular, singular(@klass)
end
test_to_model_called_on_record()
# File activemodel/test/cases/naming_test.rb, line 225
def test_to_model_called_on_record
  assert_equal 'post_named_track_backs', plural(Post::TrackBack.new)
end
test_uncountable()
# File activemodel/test/cases/naming_test.rb, line 263
def test_uncountable
  assert uncountable?(@uncountable), "Expected 'sheep' to be uncoutable"
  assert !uncountable?(@klass), "Expected 'contact' to be countable"
end
test_uncountable_route_key()
# File activemodel/test/cases/naming_test.rb, line 268
def test_uncountable_route_key
  assert_equal "sheep", singular_route_key(@uncountable)
  assert_equal "sheep_index", route_key(@uncountable)
end