From a78cb352e645590ed7e0dab17beeb2d1d5aa442a Mon Sep 17 00:00:00 2001 From: Ruxton Date: Mon, 8 Oct 2012 09:13:03 +0800 Subject: [PATCH] updated spec to fix to_datetime issue Conflicts: spec/lib/diaspora/fetcher/public_spec.rb --- spec/lib/diaspora/fetcher/public_spec.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/spec/lib/diaspora/fetcher/public_spec.rb b/spec/lib/diaspora/fetcher/public_spec.rb index 07f89812a..382df7637 100644 --- a/spec/lib/diaspora/fetcher/public_spec.rb +++ b/spec/lib/diaspora/fetcher/public_spec.rb @@ -86,10 +86,10 @@ describe PublicFetcher do process_posts } end - + it 'applies the date from JSON to the record' do @data.each do |post| - date = ActiveSupport::TimeZone.new('UTC').parse(post['created_at']) + date = ActiveSupport::TimeZone.new('UTC').parse(post['created_at']).to_datetime entry = StatusMessage.find_by_guid(post['guid']) entry.created_at.should eql(date) @@ -102,6 +102,15 @@ describe PublicFetcher do entry.raw_message.should eql(post['text']) end end + + it 'applies now to interacted_at on the record' do + @data.each do |post| + date = ActiveSupport::TimeZone.new('UTC').parse(@now.to_s).to_datetime + + entry = StatusMessage.find_by_guid(post['guid']) + entry.interacted_at.should eql(date) + end + end end end @@ -235,4 +244,4 @@ describe PublicFetcher do end end end -end \ No newline at end of file +end