From 39caffc60346ced4a1d0ef9cdb18d5cb81c97401 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 8 Jun 2014 18:52:18 +0200 Subject: [PATCH] Improved unit tests. --- test/unit/email_process_test.rb | 9 +++++++-- test/unit/twitter_test.rb | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index 1c7f15592..5e5b74bb7 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -203,6 +203,11 @@ Some Text', end test 'process with postmaster filter' do + group = Group.create_if_not_exists( + :name => 'Test Group', + :created_by_id => 1, + :updated_by_id => 1, + ) PostmasterFilter.destroy_all PostmasterFilter.create( :name => 'not used', @@ -223,7 +228,7 @@ Some Text', :from => 'me@example.com', }, :perform => { - 'X-Zammad-Ticket-group_id' => 2, + 'X-Zammad-Ticket-group_id' => group.id, 'x-Zammad-Article-Internal' => true, }, :channel => 'email', @@ -256,7 +261,7 @@ Some Text', :success => true, :result => { 0 => { - :group => 'Twitter', + :group => group.name, :ticket_priority => '2 normal', :title => 'some subject', }, diff --git a/test/unit/twitter_test.rb b/test/unit/twitter_test.rb index df6517302..ef177b9e1 100644 --- a/test/unit/twitter_test.rb +++ b/test/unit/twitter_test.rb @@ -140,7 +140,7 @@ class TwitterTest < ActiveSupport::TestCase dms.each {|dm| client.destroy_direct_message(dm.id) } - sleep 5 + sleep 10 hash = '#citheo44' + rand(9999).to_s text = 'How about the details? ' + hash @@ -154,7 +154,7 @@ class TwitterTest < ActiveSupport::TestCase article = nil (1..4).each {|loop| next if article - sleep 15 + sleep 25 Channel.fetch