Sha256: a62cd2ce9a5d6cc8791c063ae0853c68f7af13745bf01cef8713b29b2d3f1e57

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

require 'test_helper'

class PresenceAtLeastOneValidatorTest < Test::Unit::TestCase
  def test_none_attributes
    assert expense_report.invalid?
  end

  def test_one_attribute
    assert expense_report(:customer => 'nohup').valid?
    assert expense_report(:service_provider => 'nohup').valid?
  end

  def test_all_attributes
    assert expense_report(:customer => 'nohup', :service_provider => 'nohup').valid?
  end

  protected

  def expense_report(attributes = {})
    ExpenseReport.new(attributes)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
presence_at_least_one_validator-0.1.0 test/presence_at_least_one_validator_test.rb