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