##// END OF EJS Templates
Merged r10253, r10257, r10263 and r10264 from trunk to 1.4-stable...
Toshi MARUYAMA -
r10083:5d3bdb66cd8b
parent child
Show More
@@ -105,26 +105,50 class IssuesHelperTest < ActionView::TestCase
105 105 end
106 106 end
107 107
108 context "with a start_date attribute" do
109 should "format the current date" do
110 @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date')
108 def test_with_a_start_date_attribute_should_format_the_current_date
109 @detail = JournalDetail.new(
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 116 assert_match "01/31/2010", show_detail(@detail, true)
112 117 end
118 end
113 119
114 should "format the old date" do
115 @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date')
120 def test_with_a_start_date_attribute_should_format_the_old_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 128 assert_match "01/01/2010", show_detail(@detail, true)
117 129 end
118 130 end
119 131
120 context "with a due_date attribute" do
121 should "format the current date" do
122 @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date')
132 def test_with_a_due_date_attribute_should_with_a_due_date_attribute
133 @detail = JournalDetail.new(
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 140 assert_match "01/31/2010", show_detail(@detail, true)
124 141 end
142 end
125 143
126 should "format the old date" do
127 @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date')
144 def test_with_a_due_date_attribute_should_format_the_old_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 152 assert_match "01/01/2010", show_detail(@detail, true)
129 153 end
130 154 end
General Comments 0
You need to be logged in to leave comments. Login now