diff --git a/app/models/page.rb b/app/models/page.rb index f617b0cd..5765cf1e 100755 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -20,7 +20,7 @@ class Page # by the same author, not more than 30 minutes ago, then update the last revision instead of # creating a new one if !@revisions.empty? && continous_revision?(created_at, author) - @revisions.last.created_at = Time.now + @revisions.last.created_at = created_at @revisions.last.content = content @revisions.last.clear_display_cache else diff --git a/test/unit/page_test.rb b/test/unit/page_test.rb index 086f7ff5..7c6540ee 100755 --- a/test/unit/page_test.rb +++ b/test/unit/page_test.rb @@ -64,6 +64,7 @@ class PageTest < Test::Unit::TestCase @page.revise("HisWay would be MyWay in kinda update", Time.local(2004, 4, 4, 16, 57), "MarianneSyhler") assert_equal 2, @page.revisions.length assert_equal "HisWay would be MyWay in kinda update", @page.revisions.last.content + assert_equal Time.local(2004, 4, 4, 16, 57), @page.revisions.last.created_at @page.revise("HisWay would be MyWay in the house", Time.local(2004, 4, 4, 16, 58), "DavidHeinemeierHansson") assert_equal 3, @page.revisions.length