Commit fe11a9f3b635b44140e50613f91ac9f29bb8c170
1 parent
8337316e
Exists in
master
and in
28 other branches
ActionItem916: fixing tests
Showing
1 changed file
with
12 additions
and
12 deletions
Show diff stats
db/migrate/059_add_birth_date_to_person.rb
... | ... | @@ -47,62 +47,62 @@ if $PROGRAM_NAME == __FILE__ |
47 | 47 | class ConvertDatesTest < Test::Unit::TestCase |
48 | 48 | |
49 | 49 | should 'convert with slash' do |
50 | - date = ConvertDates.convert('10/01/2009') | |
50 | + date = AddBirthDateToPerson::ConvertDates.convert('10/01/2009') | |
51 | 51 | assert_equal [10, 1, 2009], [date.day, date.month, date.year] |
52 | 52 | end |
53 | 53 | |
54 | 54 | should 'convert with hyphen' do |
55 | - date = ConvertDates.convert('10-01-2009') | |
55 | + date = AddBirthDateToPerson::ConvertDates.convert('10-01-2009') | |
56 | 56 | assert_equal [10, 1, 2009], [date.day, date.month, date.year] |
57 | 57 | end |
58 | 58 | |
59 | 59 | should 'convert with dot' do |
60 | - date = ConvertDates.convert('10.01.2009') | |
60 | + date = AddBirthDateToPerson::ConvertDates.convert('10.01.2009') | |
61 | 61 | assert_equal [10, 1, 2009], [date.day, date.month, date.year] |
62 | 62 | end |
63 | 63 | |
64 | 64 | should 'convert with slash and space' do |
65 | - date = ConvertDates.convert('10/ 01/ 2009') | |
65 | + date = AddBirthDateToPerson::ConvertDates.convert('10/ 01/ 2009') | |
66 | 66 | assert_equal [10, 1, 2009], [date.day, date.month, date.year] |
67 | 67 | end |
68 | 68 | |
69 | 69 | should 'convert with empty to nil' do |
70 | - date = ConvertDates.convert('') | |
70 | + date = AddBirthDateToPerson::ConvertDates.convert('') | |
71 | 71 | assert_nil date |
72 | 72 | end |
73 | 73 | |
74 | 74 | should 'convert with nil to nil' do |
75 | - date = ConvertDates.convert(nil) | |
75 | + date = AddBirthDateToPerson::ConvertDates.convert(nil) | |
76 | 76 | assert_nil date |
77 | 77 | end |
78 | 78 | |
79 | 79 | should 'convert with two digits 1900' do |
80 | - date = ConvertDates.convert('10/01/99') | |
80 | + date = AddBirthDateToPerson::ConvertDates.convert('10/01/99') | |
81 | 81 | assert_equal [10, 1, 1999], [date.day, date.month, date.year] |
82 | 82 | end |
83 | 83 | |
84 | 84 | should 'convert with two digits 2000' do |
85 | - date = ConvertDates.convert('10/01/09') | |
85 | + date = AddBirthDateToPerson::ConvertDates.convert('10/01/09') | |
86 | 86 | assert_equal [10, 1, 2009], [date.day, date.month, date.year] |
87 | 87 | end |
88 | 88 | |
89 | 89 | should 'convert with two numbers' do |
90 | - date = ConvertDates.convert('10/01') | |
90 | + date = AddBirthDateToPerson::ConvertDates.convert('10/01') | |
91 | 91 | assert_equal [10, 1, (Date.today.year - 100)], [date.day, date.month, date.year] |
92 | 92 | end |
93 | 93 | |
94 | 94 | should 'convert to nil if non-numeric date' do |
95 | - date = ConvertDates.convert('10 de agosto de 2009') | |
95 | + date = AddBirthDateToPerson::ConvertDates.convert('10 de agosto de 2009') | |
96 | 96 | assert_nil date |
97 | 97 | end |
98 | 98 | |
99 | 99 | should 'do nothing if date' do |
100 | - date = ConvertDates.convert(Date.today) | |
100 | + date = AddBirthDateToPerson::ConvertDates.convert(Date.today) | |
101 | 101 | assert_equal Date.today, date |
102 | 102 | end |
103 | 103 | |
104 | 104 | should 'return nil when not string nor date' do |
105 | - date = ConvertDates.convert(1001) | |
105 | + date = AddBirthDateToPerson::ConvertDates.convert(1001) | |
106 | 106 | assert_nil date |
107 | 107 | end |
108 | 108 | ... | ... |