added full spec

This commit is contained in:
Adam Meehan 2008-07-07 15:10:08 +10:00
parent 68463908be
commit bb42ef215f

View File

@ -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)
end
end
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