Sha256: b437e636f45b33b02d098f34dbc7e76dae549856151801015a7959001c4697e3

Contents?: true

Size: 504 Bytes

Versions: 51

Compression:

Stored size: 504 Bytes

Contents

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

module Functional
  class ValidatesAcceptanceOfTest < Test::Unit::TestCase
    test "given no acceptance, when validated, then error is in the objects error collection" do
      klass = Class.new do
        include Validatable
        attr_accessor :name
        validates_acceptance_of :name
      end
      instance = klass.new
      instance.valid?
      assert_equal "must be accepted", instance.errors.on(:name)
    end
  end
end

Version data entries

51 entries across 51 versions & 10 rubygems

Version Path
validatable-1.1.2 test/functional/validates_acceptance_of_test.rb
validatable-1.2.1 test/functional/validates_acceptance_of_test.rb
validatable-1.3.0 test/functional/validates_acceptance_of_test.rb
validatable-1.3.4 test/functional/validates_acceptance_of_test.rb
validatable-1.4.0 test/functional/validates_acceptance_of_test.rb
validatable-1.6.1 test/functional/validates_acceptance_of_test.rb
validatable-1.1.0 test/functional/validates_acceptance_of_test.rb
validatable-1.1.1 test/functional/validates_acceptance_of_test.rb
validatable-1.2.2 test/functional/validates_acceptance_of_test.rb
validatable-1.6.0 test/functional/validates_acceptance_of_test.rb
validatable-1.6.2 test/functional/validates_acceptance_of_test.rb