From 23f499dffc169eb4d367de100e9ebcf0b80c47e6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 16 Oct 2018 16:37:46 +0200 Subject: [PATCH] Improved test. --- test/unit/email_process_out_of_office_test.rb | 16 ++++++++-------- test/unit/user_out_of_office_test.rb | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/unit/email_process_out_of_office_test.rb b/test/unit/email_process_out_of_office_test.rb index cce276097..3fcff5326 100644 --- a/test/unit/email_process_out_of_office_test.rb +++ b/test/unit/email_process_out_of_office_test.rb @@ -4,7 +4,7 @@ class EmailProcessOutOfOfficeTest < ActiveSupport::TestCase test 'process with out of office check - ms' do - ticket = Ticket.create( + ticket = Ticket.create!( title: 'ooo check - ms', group: Group.lookup(name: 'Users'), customer_id: 2, @@ -13,7 +13,7 @@ class EmailProcessOutOfOfficeTest < ActiveSupport::TestCase updated_by_id: 1, created_by_id: 1, ) - article = Ticket::Article.create( + article = Ticket::Article.create!( ticket_id: ticket.id, from: 'some_sender@example.com', to: 'some_recipient@example.com', @@ -90,7 +90,7 @@ Some Text" test 'process with out of office check - zimbra' do - ticket = Ticket.create( + ticket = Ticket.create!( title: 'ooo check - zimbra', group: Group.lookup(name: 'Users'), customer_id: 2, @@ -99,7 +99,7 @@ Some Text" updated_by_id: 1, created_by_id: 1, ) - article = Ticket::Article.create( + article = Ticket::Article.create!( ticket_id: ticket.id, from: 'some_sender@example.com', to: 'some_recipient@example.com', @@ -168,7 +168,7 @@ Some Text" test 'process with out of office check - cloud' do - ticket = Ticket.create( + ticket = Ticket.create!( title: 'ooo check - cloud', group: Group.lookup(name: 'Users'), customer_id: 2, @@ -177,7 +177,7 @@ Some Text" updated_by_id: 1, created_by_id: 1, ) - article = Ticket::Article.create( + article = Ticket::Article.create!( ticket_id: ticket.id, from: 'some_sender@example.com', to: 'some_recipient@example.com', @@ -241,7 +241,7 @@ Some Text" test 'process with out of office check - gmail' do - ticket = Ticket.create( + ticket = Ticket.create!( title: 'ooo check - gmail', group: Group.lookup(name: 'Users'), customer_id: 2, @@ -250,7 +250,7 @@ Some Text" updated_by_id: 1, created_by_id: 1, ) - article = Ticket::Article.create( + article = Ticket::Article.create!( ticket_id: ticket.id, from: 'some_sender@example.com', to: 'some_recipient@example.com', diff --git a/test/unit/user_out_of_office_test.rb b/test/unit/user_out_of_office_test.rb index 07cc65e02..b60487162 100644 --- a/test/unit/user_out_of_office_test.rb +++ b/test/unit/user_out_of_office_test.rb @@ -7,7 +7,7 @@ class UserOutOfOfficeTest < ActiveSupport::TestCase groups = Group.all roles = Role.where(name: 'Agent') - @agent1 = User.create_or_update( + @agent1 = User.create!( login: 'user-out_of_office-agent1@example.com', firstname: 'UserOutOfOffice', lastname: 'Agent1', @@ -18,7 +18,7 @@ class UserOutOfOfficeTest < ActiveSupport::TestCase roles: roles, groups: groups, ) - @agent2 = User.create_or_update( + @agent2 = User.create!( login: 'user-out_of_office-agent2@example.com', firstname: 'UserOutOfOffice', lastname: 'Agent2', @@ -29,7 +29,7 @@ class UserOutOfOfficeTest < ActiveSupport::TestCase roles: roles, groups: groups, ) - @agent3 = User.create_or_update( + @agent3 = User.create!( login: 'user-out_of_office-agent3@example.com', firstname: 'UserOutOfOffice', lastname: 'Agent3',