mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-24 23:06:42 +00:00
tweak instance tag spec
This commit is contained in:
parent
82c0e1bcd3
commit
4df1974524
@ -32,13 +32,30 @@ describe 'ValidatesTimeliness::ActionView::InstanceTag' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should display datetime_select when datetime value is nil" do
|
it "should not set values in datetime_select when datetime value is nil" do
|
||||||
@person.birth_date_and_time = nil
|
@person.birth_date_and_time = nil
|
||||||
output = datetime_select(:person, :birth_date_and_time, :include_blank => true, :include_seconds => true)
|
output = datetime_select(:person, :birth_date_and_time, :include_blank => true, :include_seconds => true)
|
||||||
output.should have_tag('select', 6)
|
output.should have_tag('select[id=person_birth_date_and_time_1i]') do
|
||||||
|
without_tag('option[selected=selected]')
|
||||||
|
end
|
||||||
|
output.should have_tag('select[id=person_birth_date_and_time_2i]') do
|
||||||
|
without_tag('option[selected=selected]')
|
||||||
|
end
|
||||||
|
output.should have_tag('select[id=person_birth_date_and_time_3i]') do
|
||||||
|
without_tag('option[selected=selected]')
|
||||||
|
end
|
||||||
|
output.should have_tag('select[id=person_birth_date_and_time_4i]') do
|
||||||
|
without_tag('option[selected=selected]')
|
||||||
|
end
|
||||||
|
output.should have_tag('select[id=person_birth_date_and_time_5i]') do
|
||||||
|
without_tag('option[selected=selected]')
|
||||||
|
end
|
||||||
|
output.should have_tag('select[id=person_birth_date_and_time_6i]') do
|
||||||
|
without_tag('option[selected=selected]')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should display datetime_select with no values selected for missing parts" do
|
it "should not set value in datetime_select where datetime string has empty value" do
|
||||||
@person.birth_date_and_time = '2000-- ::'
|
@person.birth_date_and_time = '2000-- ::'
|
||||||
output = datetime_select(:person, :birth_date_and_time, :include_blank => true, :include_seconds => true)
|
output = datetime_select(:person, :birth_date_and_time, :include_blank => true, :include_seconds => true)
|
||||||
output.should have_tag('select[id=person_birth_date_and_time_1i]') do
|
output.should have_tag('select[id=person_birth_date_and_time_1i]') do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user