Commit ba1449a6632263a0fc8802ae870b31618bf5b03c
1 parent
7e1172c4
Exists in
master
and in
29 other branches
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,7 +18,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase | ||
18 | end | 18 | end |
19 | 19 | ||
20 | should 'list amount posts by year' do | 20 | should 'list amount posts by year' do |
21 | - date = DateTime.parse('2008-01-01') | 21 | + date = DateTime.parse('2008-01-10') |
22 | blog = profile.blog | 22 | blog = profile.blog |
23 | for i in 1..10 do | 23 | for i in 1..10 do |
24 | post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, :parent_id => blog.id) | 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,7 +30,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase | ||
30 | end | 30 | end |
31 | 31 | ||
32 | should 'list amount posts by month' do | 32 | should 'list amount posts by month' do |
33 | - date = DateTime.parse('2008-01-01') | 33 | + date = DateTime.parse('2008-01-10') |
34 | blog = profile.blog | 34 | blog = profile.blog |
35 | for i in 1..10 do | 35 | for i in 1..10 do |
36 | post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, :parent_id => blog.id) | 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,7 +103,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase | ||
103 | end | 103 | end |
104 | 104 | ||
105 | should 'list amount native posts by year' do | 105 | should 'list amount native posts by year' do |
106 | - date = DateTime.parse('2008-01-01') | 106 | + date = DateTime.parse('2008-01-10') |
107 | blog = profile.blog | 107 | blog = profile.blog |
108 | 2.times do |i| | 108 | 2.times do |i| |
109 | post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, | 109 | post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, |
@@ -119,7 +119,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase | @@ -119,7 +119,7 @@ class BlogArchivesBlockTest < ActiveSupport::TestCase | ||
119 | end | 119 | end |
120 | 120 | ||
121 | should 'list amount native posts by month' do | 121 | should 'list amount native posts by month' do |
122 | - date = DateTime.parse('2008-01-01') | 122 | + date = DateTime.parse('2008-01-10') |
123 | blog = profile.blog | 123 | blog = profile.blog |
124 | 2.times do |i| | 124 | 2.times do |i| |
125 | post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, | 125 | post = fast_create(TextileArticle, :name => "post #{i} test", :profile_id => profile.id, |