mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
added full spec
This commit is contained in:
parent
68463908be
commit
bb42ef215f
@ -6,13 +6,18 @@ describe ValidatesTimeliness::InstanceTag, :type => :helper do
|
|||||||
@person = Person.new
|
@person = Person.new
|
||||||
end
|
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"
|
@person.birth_date_and_time = "2008-02-30 12:00:00"
|
||||||
output = date_select(:person, :birth_date_and_time, :include_blank => true)
|
output = date_select(:person, :birth_date_and_time, :include_blank => true)
|
||||||
puts output
|
|
||||||
output.should have_tag('select') do
|
output.should have_tag('select[id=person_birth_date_and_time_1i]') do
|
||||||
with_tag('input[type=text]', 3)
|
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
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user