From bb42ef215fbb517f61e48f9ae3d78b249377d1dd Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Mon, 7 Jul 2008 15:10:08 +1000 Subject: [PATCH] added full spec --- spec/instance_tag_spec.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/spec/instance_tag_spec.rb b/spec/instance_tag_spec.rb index f86ceb8..cddd336 100644 --- a/spec/instance_tag_spec.rb +++ b/spec/instance_tag_spec.rb @@ -6,13 +6,18 @@ describe ValidatesTimeliness::InstanceTag, :type => :helper do @person = Person.new end - it "should return struct for time string" do + it "should display invalid date as date_select values" do @person.birth_date_and_time = "2008-02-30 12:00:00" output = date_select(:person, :birth_date_and_time, :include_blank => true) - puts output - output.should have_tag('select') do - with_tag('input[type=text]', 3) + + output.should have_tag('select[id=person_birth_date_and_time_1i]') do + with_tag('option[selected=selected]', '2008') + end + output.should have_tag('select[id=person_birth_date_and_time_2i]') do + with_tag('option[selected=selected]', 'February') + end + output.should have_tag('select[id=person_birth_date_and_time_3i]') do + with_tag('option[selected=selected]', '30') end end - end