@@ -109,27 +109,29 class IssuesHelperTest < ActionView::TestCase | |||||
109 | end |
|
109 | end | |
110 | end |
|
110 | end | |
111 |
|
111 | |||
112 | def test_with_a_start_date_attribute_should_format_the_current_date |
|
112 | context "with a start_date attribute" do | |
113 | @detail = JournalDetail.new( |
|
113 | should "format the current date" do | |
|
114 | @detail = JournalDetail.new( | |||
114 | :property => 'attr', |
|
115 | :property => 'attr', | |
115 | :old_value => '2010-01-01', |
|
116 | :old_value => '2010-01-01', | |
116 | :value => '2010-01-31', |
|
117 | :value => '2010-01-31', | |
117 | :prop_key => 'start_date' |
|
118 | :prop_key => 'start_date' | |
118 | ) |
|
119 | ) | |
119 | with_settings :date_format => '%m/%d/%Y' do |
|
120 | with_settings :date_format => '%m/%d/%Y' do | |
120 | assert_match "01/31/2010", show_detail(@detail, true) |
|
121 | assert_match "01/31/2010", show_detail(@detail, true) | |
|
122 | end | |||
121 | end |
|
123 | end | |
122 | end |
|
|||
123 |
|
124 | |||
124 | def test_with_a_start_date_attribute_should_format_the_old_date |
|
125 | should "format the old date" do | |
125 | @detail = JournalDetail.new( |
|
126 | @detail = JournalDetail.new( | |
126 | :property => 'attr', |
|
127 | :property => 'attr', | |
127 | :old_value => '2010-01-01', |
|
128 | :old_value => '2010-01-01', | |
128 | :value => '2010-01-31', |
|
129 | :value => '2010-01-31', | |
129 | :prop_key => 'start_date' |
|
130 | :prop_key => 'start_date' | |
130 | ) |
|
131 | ) | |
131 | with_settings :date_format => '%m/%d/%Y' do |
|
132 | with_settings :date_format => '%m/%d/%Y' do | |
132 | assert_match "01/01/2010", show_detail(@detail, true) |
|
133 | assert_match "01/01/2010", show_detail(@detail, true) | |
|
134 | end | |||
133 | end |
|
135 | end | |
134 | end |
|
136 | end | |
135 |
|
137 |
General Comments 0
You need to be logged in to leave comments.
Login now