Sha256: 656eaa1a958713631fe809d2f45b524dc5852995c9225f0914454e0ed877d064

Contents?: true

Size: 737 Bytes

Versions: 8

Compression:

Stored size: 737 Bytes

Contents

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

class ValidatesAcceptanceOfTest < Test::Unit::TestCase
  test "valid acceptance" do
    validation = Validatable::ValidatesAcceptanceOf.new stub, :acceptance
    instance = stub(:acceptance=>'true')
    assert_equal true, validation.valid?(instance)
  end
  
  test "invalid acceptance" do
    validation = Validatable::ValidatesAcceptanceOf.new stub, :acceptance
    instance = stub(:acceptance=>'false')
    assert_equal false, validation.valid?(instance)
  end
  
  expect true do
    options = {:message => nil, :if => nil, :times => nil, :level => nil, :groups => nil}
    Validatable::ValidatesAcceptanceOf.new(stub, :test).must_understand(options)
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
validatable-1.5.0 test/unit/validates_acceptance_of_test.rb
validatable-1.6.1 test/unit/validates_acceptance_of_test.rb
validatable-1.6.4 test/unit/validates_acceptance_of_test.rb
validatable-1.4.0 test/unit/validates_acceptance_of_test.rb
validatable-1.5.2 test/unit/validates_acceptance_of_test.rb
validatable-1.6.0 test/unit/validates_acceptance_of_test.rb
validatable-1.6.2 test/unit/validates_acceptance_of_test.rb
validatable-1.6.3 test/unit/validates_acceptance_of_test.rb