From 7dd579b0e061050f6fb9e3c8bf5d0852772f77de Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Mon, 15 Oct 2012 08:45:57 +1100 Subject: [PATCH] Get rid of this silly constant for nil array value --- spec/validates_timeliness/validator_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/validates_timeliness/validator_spec.rb b/spec/validates_timeliness/validator_spec.rb index 2b8970a..94d90bc 100644 --- a/spec/validates_timeliness/validator_spec.rb +++ b/spec/validates_timeliness/validator_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe ValidatesTimeliness::Validator do - NIL = [nil] - before do Timecop.freeze(Time.local_time(2010, 1, 1, 0, 0, 0)) end @@ -46,13 +44,13 @@ describe ValidatesTimeliness::Validator do describe ":allow_nil option" do it 'should not allow nil by default' do Person.validates_date :birth_date - invalid!(:birth_date, NIL, 'is not a valid date') + invalid!(:birth_date, [nil], 'is not a valid date') valid!(:birth_date, Date.today) end it 'should allow nil when true' do Person.validates_date :birth_date, :allow_nil => true - valid!(:birth_date, NIL) + valid!(:birth_date, [nil]) end context "with raw value cache" do