Fixed/ improved test.

This commit is contained in:
Martin Edenhofer 2018-12-07 13:11:08 +01:00
parent 079c4c9593
commit d105bc4c60
2 changed files with 7 additions and 4 deletions

View file

@ -177,10 +177,12 @@ returns
next if !track_retweets? && tweet.retweet?
# ignore older messages
if (@channel.created_at - 15.days) > tweet.created_at.dup.utc || older_import >= older_import_max
older_import += 1
Rails.logger.debug { "tweet to old: #{tweet.id}/#{tweet.created_at}" }
next
if @sync[:import_older_tweets] != true
if (@channel.created_at - 15.days) > tweet.created_at.dup.utc || older_import >= older_import_max
older_import += 1
Rails.logger.debug { "tweet to old: #{tweet.id}/#{tweet.created_at}" }
next
end
end
next if @client.locale_sender?(tweet) && own_tweet_already_imported?(tweet)

View file

@ -21,6 +21,7 @@ RSpec.describe ::Channel::Driver::Twitter do
id: 'system_id',
},
sync: {
import_older_tweets: true,
track_retweets: true,
search: [
{