Improved timings.

This commit is contained in:
Martin Edenhofer 2016-01-22 09:33:28 +01:00
parent 3587051827
commit b4dd569cda

View file

@ -88,7 +88,7 @@ class TwitterTest < ActiveSupport::TestCase
test 'a new outbound and reply' do test 'a new outbound and reply' do
hash = '#citheo42' + rand(99_999).to_s hash = '#citheo42' + rand(999_999).to_s
user = User.find(2) user = User.find(2)
text = "Today the weather is really nice... #{hash}" text = "Today the weather is really nice... #{hash}"
ticket = Ticket.create( ticket = Ticket.create(
@ -134,7 +134,7 @@ class TwitterTest < ActiveSupport::TestCase
} }
assert(tweet_found, "found outbound '#{text}' tweet '#{article.message_id}'") assert(tweet_found, "found outbound '#{text}' tweet '#{article.message_id}'")
reply_text = '@armin_theo on my side the weather is nice, too! 😍😍😍 #weather' + rand(99_999).to_s reply_text = '@armin_theo on my side the weather is nice, too! 😍😍😍 #weather' + rand(999_999).to_s
tweet = client.update( tweet = client.update(
reply_text, reply_text,
{ {
@ -178,7 +178,7 @@ class TwitterTest < ActiveSupport::TestCase
config.access_token_secret = me_bauer_token_secret config.access_token_secret = me_bauer_token_secret
end end
hash = '#citheo24 #' + rand(99_999).to_s hash = '#citheo24 #' + rand(999_999).to_s
text = "Today... #{hash}" text = "Today... #{hash}"
tweet = client.update( tweet = client.update(
text, text,
@ -187,7 +187,7 @@ class TwitterTest < ActiveSupport::TestCase
# fetch check system account # fetch check system account
sleep 15 sleep 15
article = nil article = nil
(1..2).each { (1..3).each {
Channel.fetch Channel.fetch
# check if ticket and article has been created # check if ticket and article has been created
@ -201,7 +201,7 @@ class TwitterTest < ActiveSupport::TestCase
ticket = article.ticket ticket = article.ticket
# send reply # send reply
reply_text = '@me_bauer on my side #weather' + rand(99_999).to_s reply_text = '@me_bauer on my side #weather' + rand(999_999).to_s
article = Ticket::Article.create( article = Ticket::Article.create(
ticket_id: ticket.id, ticket_id: ticket.id,
body: reply_text, body: reply_text,
@ -254,7 +254,7 @@ class TwitterTest < ActiveSupport::TestCase
dms.each {|dm| dms.each {|dm|
client.destroy_direct_message(dm.id) client.destroy_direct_message(dm.id)
} }
hash = '#citheo44' + rand(99_999).to_s hash = '#citheo44' + rand(999_999).to_s
text = 'How about the details? ' + hash text = 'How about the details? ' + hash
dm = client.create_direct_message( dm = client.create_direct_message(
'armin_theo', 'armin_theo',
@ -382,7 +382,7 @@ class TwitterTest < ActiveSupport::TestCase
config.access_token = me_bauer_token config.access_token = me_bauer_token
config.access_token_secret = me_bauer_token_secret config.access_token_secret = me_bauer_token_secret
end end
hash = '#citheo24 #' + rand(99_999).to_s hash = '#citheo24 #' + rand(999_999).to_s
text = "Today... #{hash}" text = "Today... #{hash}"
tweet = client.update( tweet = client.update(
text, text,
@ -405,7 +405,7 @@ class TwitterTest < ActiveSupport::TestCase
config.access_token = me_bauer_token config.access_token = me_bauer_token
config.access_token_secret = me_bauer_token_secret config.access_token_secret = me_bauer_token_secret
end end
hash = '#citheo24 #' + rand(99_999).to_s hash = '#citheo24 #' + rand(999_999).to_s
text = "Today...2 #{hash}" text = "Today...2 #{hash}"
tweet = client.update( tweet = client.update(
text, text,
@ -429,7 +429,7 @@ class TwitterTest < ActiveSupport::TestCase
access_token: me_bauer_token, access_token: me_bauer_token,
access_token_secret: me_bauer_token_secret access_token_secret: me_bauer_token_secret
) )
hash = '#citheo44' + rand(99_999).to_s hash = '#citheo44' + rand(999_999).to_s
text = 'How about the details? ' + hash text = 'How about the details? ' + hash
dm = client.create_direct_message( dm = client.create_direct_message(
'armin_theo', 'armin_theo',