Skip to content

Commit

Permalink
Test dates in Enitity with text inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Feb 25, 2018
1 parent b78ef96 commit 3f612a7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/cff_entity_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ def test_date_fields_set_and_output_correctly
assert y.include? "date-start: #{date.to_s}\n"
end

def test_date_fields_set_and_output_correctly_with_text
date = "1999-12-31"
@entity.date_end = date
@entity.date_start = date

assert_equal @entity.date_end, Date.parse(date)
assert_equal @entity.date_start, Date.parse(date)

y = @entity.fields.to_yaml

assert y.include? "date-end: #{date}\n"
assert y.include? "date-start: #{date}\n"
end

def test_tel_fax_fields_set_and_output_correctly
number = "+44 (0) 161-234-5678"
@entity.fax = number
Expand Down

0 comments on commit 3f612a7

Please sign in to comment.