GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/zmack/mephisto.git
fix comment time comparison test bug
technoweenie (author)
Mon Mar 10 23:46:44 -0700 2008
commit  61c7122a62226b4d146656ed9f484c42d82eadb1
tree    bc9dafb073613f326c5358863ead5a1f1bcdf7fa
parent  c62b1a257ddecd3d6b72b9e77c914bb7e2358d65
...
168
169
170
171
172
173
174
175
...
179
180
181
 
 
182
183
184
...
168
169
170
 
 
171
172
173
...
177
178
179
180
181
182
183
184
0
@@ -168,8 +168,6 @@ ActiveRecord::Schema.define(:version => 75) do
0
     t.text "ping_urls"
0
     t.integer "articles_per_page", :default => 15
0
     t.string "host"
0
- t.string "akismet_key", :limit => 100
0
- t.string "akismet_url"
0
     t.boolean "approve_comments"
0
     t.integer "comment_age"
0
     t.string "timezone"
0
@@ -179,6 +177,8 @@ ActiveRecord::Schema.define(:version => 75) do
0
     t.string "tag_path"
0
     t.string "tag_layout"
0
     t.string "current_theme_path"
0
+ t.string "akismet_key", :limit => 100
0
+ t.string "akismet_url"
0
   end
0
 
0
   add_index "sites", ["host"], :name => "index_sites_on_host"
...
111
112
113
114
 
115
116
117
118
 
119
120
121
...
174
175
176
177
 
178
179
180
...
111
112
113
 
114
115
116
117
 
118
119
120
121
...
174
175
176
 
177
178
179
180
0
@@ -111,11 +111,11 @@ class ArticleTest < Test::Unit::TestCase
0
 
0
   def test_comment_expiration_date
0
     a = create_fake_article
0
- assert_equal 5.days.from_now.utc.to_i, a.comments_expired_at.to_i
0
+ assert_equal((a.published_at + 10.days), a.comments_expired_at)
0
   end
0
 
0
   def test_comment_expiry
0
- a = create_fake_article(5.days.from_now)
0
+ a = create_fake_article(5.days.from_now.utc)
0
     assert !a.accept_comments?
0
     a.published_at = 5.days.ago.utc
0
     assert a.accept_comments?
0
@@ -174,7 +174,7 @@ class ArticleTest < Test::Unit::TestCase
0
       Article.create options.reverse_merge(:user_id => 1, :site_id => 1, :title => 'foo')
0
     end
0
     
0
- def create_fake_article(time = 5.days.ago)
0
+ def create_fake_article(time = 5.days.ago.utc)
0
       returning Article.new(:comment_age => 10, :published_at => time.utc) do |a|
0
         def a.new_record?() false ; end
0
       end

Comments

    No one has commented yet.