Sha256: 6a9ae5fb2b724c10edcfb46dd629df5c522b6b4d5fd131e527b48bf0e541fd4c

Contents?: true

Size: 827 Bytes

Versions: 1

Compression:

Stored size: 827 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

class ErrorsTest < Test::Unit::TestCase
  expect "message" do
    errors = Validatable::Errors.new
    errors.add(:attribute, "message")
    errors.on(:attribute)
  end
  
  expect "Capitalized word" do
    errors = Validatable::Errors.new
    errors.humanize("capitalized_word")
  end
  
  expect "Capitalized word without" do
    errors = Validatable::Errors.new
    errors.humanize("capitalized_word_without_id")
  end
  
  expect ["A humanized message", "a base message"] do
    errors = Validatable::Errors.new
    errors.add(:base, "a base message")
    errors.add(:a_humanized, "message")
    errors.full_messages.sort
  end
  
  test "includes enumerable" do
    assert_equal true, Validatable::Errors.included_modules.include?(Enumerable)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validatable-1.3.2 test/unit/errors_test.rb