Sha256: 3efd9f8212a664d29f2b62ab9ee8475293d3f52d1e4bf3a0f5b6c04c33885d29

Contents?: true

Size: 739 Bytes

Versions: 2

Compression:

Stored size: 739 Bytes

Contents

require 'test_helper'
require 'active_support/core_ext/hash/reverse_merge'
ActiveValidators.activate(:date)

# ActiveValidators relies on another gem called "date_validator" edited
# by the fine folks at Codegram.
#
# If you wanna see tests for this gem, go take a look at the repository
# [on Github](https://github.com/codegram/date_validator)
describe "Date Validation" do
  it "finds the translations" do
    d = build_date_record

    refute d.valid?
    refute_includes d.errors.to_s, 'translation missing'
  end

  def build_date_record
    TestRecord.reset_callbacks(:validate)
    TestRecord.validates :start_date, :date => { :before => :end_date }
    TestRecord.new(:start_date => Time.now, :end_date => Time.now - 1)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activevalidators-6.0.0 test/validations/date_test.rb
activevalidators-5.1.0 test/validations/date_test.rb