Improved unit tests.

This commit is contained in:
Martin Edenhofer 2014-06-08 18:52:18 +02:00
parent fbf644faa1
commit 39caffc603
2 changed files with 9 additions and 4 deletions

View file

@ -203,6 +203,11 @@ Some Text',
end end
test 'process with postmaster filter' do 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.destroy_all
PostmasterFilter.create( PostmasterFilter.create(
:name => 'not used', :name => 'not used',
@ -223,7 +228,7 @@ Some Text',
:from => 'me@example.com', :from => 'me@example.com',
}, },
:perform => { :perform => {
'X-Zammad-Ticket-group_id' => 2, 'X-Zammad-Ticket-group_id' => group.id,
'x-Zammad-Article-Internal' => true, 'x-Zammad-Article-Internal' => true,
}, },
:channel => 'email', :channel => 'email',
@ -256,7 +261,7 @@ Some Text',
:success => true, :success => true,
:result => { :result => {
0 => { 0 => {
:group => 'Twitter', :group => group.name,
:ticket_priority => '2 normal', :ticket_priority => '2 normal',
:title => 'some subject', :title => 'some subject',
}, },

View file

@ -140,7 +140,7 @@ class TwitterTest < ActiveSupport::TestCase
dms.each {|dm| dms.each {|dm|
client.destroy_direct_message(dm.id) client.destroy_direct_message(dm.id)
} }
sleep 5 sleep 10
hash = '#citheo44' + rand(9999).to_s hash = '#citheo44' + rand(9999).to_s
text = 'How about the details? ' + hash text = 'How about the details? ' + hash
@ -154,7 +154,7 @@ class TwitterTest < ActiveSupport::TestCase
article = nil article = nil
(1..4).each {|loop| (1..4).each {|loop|
next if article next if article
sleep 15 sleep 25
Channel.fetch Channel.fetch