Commit ba1449a6632263a0fc8802ae870b31618bf5b03c

Authored by Antonio Terceiro
1 parent 7e1172c4

fix BlogArchiveBlock tests wrt timezone

January first is parsed in UTC, but when the local timezone is applied,
those dates end up in the wrong month.
Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
test/unit/blog_archives_block_test.rb
... ... @@ -18,7 +18,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase
18 18 end
19 19  
20 20 should 'list amount posts by year' do
21   - date = DateTime.parse('2008-01-01')
  21 + date = DateTime.parse('2008-01-10')
22 22 blog = profile.blog
23 23 for i in 1..10 do
24 24 post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, :parent_id => blog.id)
... ... @@ -30,7 +30,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase
30 30 end
31 31  
32 32 should 'list amount posts by month' do
33   - date = DateTime.parse('2008-01-01')
  33 + date = DateTime.parse('2008-01-10')
34 34 blog = profile.blog
35 35 for i in 1..10 do
36 36 post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, :parent_id => blog.id)
... ... @@ -103,7 +103,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase
103 103 end
104 104  
105 105 should 'list amount native posts by year' do
106   - date = DateTime.parse('2008-01-01')
  106 + date = DateTime.parse('2008-01-10')
107 107 blog = profile.blog
108 108 2.times do |i|
109 109 post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id,
... ... @@ -119,7 +119,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase
119 119 end
120 120  
121 121 should 'list amount native posts by month' do
122   - date = DateTime.parse('2008-01-01')
  122 + date = DateTime.parse('2008-01-10')
123 123 blog = profile.blog
124 124 2.times do |i|
125 125 post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id,
... ...