From 68dfa2e2a98ce827fb7ff8023e9298cf397c5cc4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 30 May 2014 15:36:40 +0200 Subject: [PATCH] Improved fetching dm. --- test/unit/twitter_test.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/unit/twitter_test.rb b/test/unit/twitter_test.rb index 1d3280a35..65a329059 100644 --- a/test/unit/twitter_test.rb +++ b/test/unit/twitter_test.rb @@ -149,17 +149,23 @@ class TwitterTest < ActiveSupport::TestCase text, ) assert( dm, "dm with ##{hash} created" ) - sleep 25 # fetch check system account - Channel.fetch + article = nil + (1..4).each {|loop| + next if article + sleep 15 + + Channel.fetch + + # check if ticket and article has been created + article = Ticket::Article.where( :message_id => dm.id ).last + } + puts "----------------------------------------" + puts "DM: " + dm.inspect + puts "AT: " + article.inspect + puts "----------------------------------------" - # check if ticket and article has been created - article = Ticket::Article.where( :message_id => dm.id ).last -puts "----------------------------------------" -puts "DM: " + dm.inspect -puts "AT: " + article.inspect -puts "----------------------------------------" assert( article, "inbound article created" ) # ticket = Ticket.find( article.ticket.id ) ticket = article.ticket