Improved timing for tests.

This commit is contained in:
Martin Edenhofer 2015-08-31 11:27:42 +02:00
parent 271c6f933b
commit 4fe43fd321

View file

@ -2047,7 +2047,7 @@ Some Text',
updated_by_id: 1, updated_by_id: 1,
created_by_id: 1, created_by_id: 1,
) )
sleep 1
email_raw_string = IO.read('test/fixtures/mail33-undelivered-mail-returned-to-sender.box') email_raw_string = IO.read('test/fixtures/mail33-undelivered-mail-returned-to-sender.box')
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
@ -2134,35 +2134,45 @@ no reference "
setting_orig = Setting.get('postmaster_follow_up_search_in') setting_orig = Setting.get('postmaster_follow_up_search_in')
Setting.set('postmaster_follow_up_search_in', ['body', 'attachment', 'references']) Setting.set('postmaster_follow_up_search_in', ['body', 'attachment', 'references'])
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_subject) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_subject)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_body) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_body)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_attachment) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_attachment)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references1) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references1)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references2) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references2)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
Setting.set('postmaster_follow_up_search_in', setting_orig) Setting.set('postmaster_follow_up_search_in', setting_orig)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_subject) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_subject)
assert_equal(ticket.id, ticket_p.id) assert_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_body) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_body)
assert_not_equal(ticket.id, ticket_p.id) assert_not_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_attachment) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_attachment)
assert_not_equal(ticket.id, ticket_p.id) assert_not_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references1) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references1)
assert_not_equal(ticket.id, ticket_p.id) assert_not_equal(ticket.id, ticket_p.id)
sleep 1
ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references2) ticket_p, article_p, user_p = Channel::EmailParser.new.process( {}, email_raw_string_references2)
assert_not_equal(ticket.id, ticket_p.id) assert_not_equal(ticket.id, ticket_p.id)
end end