@@ -105,26 +105,50 class IssuesHelperTest < ActionView::TestCase | |||||
105 | end |
|
105 | end | |
106 | end |
|
106 | end | |
107 |
|
107 | |||
108 | context "with a start_date attribute" do |
|
108 | def test_with_a_start_date_attribute_should_format_the_current_date | |
109 | should "format the current date" do |
|
109 | @detail = JournalDetail.new( | |
110 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date') |
|
110 | :property => 'attr', | |
|
111 | :old_value => '2010-01-01', | |||
|
112 | :value => '2010-01-31', | |||
|
113 | :prop_key => 'start_date' | |||
|
114 | ) | |||
|
115 | with_settings :date_format => '%m/%d/%Y' do | |||
111 | assert_match "01/31/2010", show_detail(@detail, true) |
|
116 | assert_match "01/31/2010", show_detail(@detail, true) | |
112 | end |
|
117 | end | |
|
118 | end | |||
113 |
|
119 | |||
114 | should "format the old date" do |
|
120 | def test_with_a_start_date_attribute_should_format_the_old_date | |
115 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date') |
|
121 | @detail = JournalDetail.new( | |
|
122 | :property => 'attr', | |||
|
123 | :old_value => '2010-01-01', | |||
|
124 | :value => '2010-01-31', | |||
|
125 | :prop_key => 'start_date' | |||
|
126 | ) | |||
|
127 | with_settings :date_format => '%m/%d/%Y' do | |||
116 | assert_match "01/01/2010", show_detail(@detail, true) |
|
128 | assert_match "01/01/2010", show_detail(@detail, true) | |
117 | end |
|
129 | end | |
118 | end |
|
130 | end | |
119 |
|
131 | |||
120 | context "with a due_date attribute" do |
|
132 | def test_with_a_due_date_attribute_should_with_a_due_date_attribute | |
121 | should "format the current date" do |
|
133 | @detail = JournalDetail.new( | |
122 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date') |
|
134 | :property => 'attr', | |
|
135 | :old_value => '2010-01-01', | |||
|
136 | :value => '2010-01-31', | |||
|
137 | :prop_key => 'due_date' | |||
|
138 | ) | |||
|
139 | with_settings :date_format => '%m/%d/%Y' do | |||
123 | assert_match "01/31/2010", show_detail(@detail, true) |
|
140 | assert_match "01/31/2010", show_detail(@detail, true) | |
124 | end |
|
141 | end | |
|
142 | end | |||
125 |
|
143 | |||
126 | should "format the old date" do |
|
144 | def test_with_a_due_date_attribute_should_format_the_old_date | |
127 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date') |
|
145 | @detail = JournalDetail.new( | |
|
146 | :property => 'attr', | |||
|
147 | :old_value => '2010-01-01', | |||
|
148 | :value => '2010-01-31', | |||
|
149 | :prop_key => 'due_date' | |||
|
150 | ) | |||
|
151 | with_settings :date_format => '%m/%d/%Y' do | |||
128 | assert_match "01/01/2010", show_detail(@detail, true) |
|
152 | assert_match "01/01/2010", show_detail(@detail, true) | |
129 | end |
|
153 | end | |
130 | end |
|
154 | end |
General Comments 0
You need to be logged in to leave comments.
Login now