We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa7d71f commit f81c944Copy full SHA for f81c944
Gemfile.lock
@@ -2,7 +2,7 @@ PATH
2
remote: .
3
specs:
4
date_validator (0.6.1)
5
- activemodel (~> 3.0.0)
+ activemodel (>= 3.0.0, < 3.2.0)
6
7
GEM
8
remote: http://rubygems.org/
spec/date_validator_spec.rb
@@ -27,6 +27,13 @@ module Validations
27
model.errors[:expiration_date].should eq(["is not a date"])
28
end
29
30
+ it "works with helper methods" do
31
+ time = Time.now
32
+ TestRecord.validates_date_of :expiration_date, :before => time
33
+ model = TestRecord.new(time + 20000)
34
+ model.should_not be_valid
35
+ end
36
+
37
[:valid,:invalid].each do |should_be|
38
_context = should_be == :valid ? 'when value validates correctly' : 'when value does not match validation requirements'
39
0 commit comments