updated spec to fix to_datetime issue

Conflicts:
	spec/lib/diaspora/fetcher/public_spec.rb
This commit is contained in:
Ruxton 2012-10-08 09:13:03 +08:00 committed by Florian Staudacher
parent f0eacc801b
commit a78cb352e6

View file

@ -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
end