From 4eef31faebf145933cfb6794f251dbd342529fbb Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 17 Jul 2015 09:39:17 +0200 Subject: [PATCH] Fixed bug: Fetching twitter article may take some time. --- test/integration/twitter_test.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/integration/twitter_test.rb b/test/integration/twitter_test.rb index cce6ed5ac..b0c427945 100644 --- a/test/integration/twitter_test.rb +++ b/test/integration/twitter_test.rb @@ -147,8 +147,18 @@ class TwitterTest < ActiveSupport::TestCase # fetch check system account Channel.fetch - # check if follow up article has been created - article = Ticket::Article.find_by( message_id: tweet.id ) + # fetch check system account + article = nil + (1..4).each { + Channel.fetch + + # check if ticket and article has been created + article = Ticket::Article.find_by( message_id: tweet.id ) + + break if article + + sleep 5 + } assert(article) ticket = article.ticket