Skip to content

Commit 3f612a7

Browse files
committed
Test dates in Enitity with text inputs.
1 parent b78ef96 commit 3f612a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/cff_entity_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ def test_date_fields_set_and_output_correctly
7171
assert y.include? "date-start: #{date.to_s}\n"
7272
end
7373

74+
def test_date_fields_set_and_output_correctly_with_text
75+
date = "1999-12-31"
76+
@entity.date_end = date
77+
@entity.date_start = date
78+
79+
assert_equal @entity.date_end, Date.parse(date)
80+
assert_equal @entity.date_start, Date.parse(date)
81+
82+
y = @entity.fields.to_yaml
83+
84+
assert y.include? "date-end: #{date}\n"
85+
assert y.include? "date-start: #{date}\n"
86+
end
87+
7488
def test_tel_fax_fields_set_and_output_correctly
7589
number = "+44 (0) 161-234-5678"
7690
@entity.fax = number

0 commit comments

Comments
 (0)