Skip to content

Commit f81c944

Browse files
committed
Add spec for new helper method
1 parent fa7d71f commit f81c944

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
date_validator (0.6.1)
5-
activemodel (~> 3.0.0)
5+
activemodel (>= 3.0.0, < 3.2.0)
66

77
GEM
88
remote: http://rubygems.org/

spec/date_validator_spec.rb

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ module Validations
2727
model.errors[:expiration_date].should eq(["is not a date"])
2828
end
2929

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+
3037
[:valid,:invalid].each do |should_be|
3138
_context = should_be == :valid ? 'when value validates correctly' : 'when value does not match validation requirements'
3239

0 commit comments

Comments
 (0)