From ca6f3a806bfa2b79cd8c03d7d74076bffd44f6b9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 2 Jan 2015 16:48:28 +0100 Subject: [PATCH] Improved code layout. --- .../application_model/history_log_base.rb | 30 +- lib/event_buffer.rb | 2 +- test/unit/ticket_test.rb | 460 +++++++++--------- 3 files changed, 246 insertions(+), 246 deletions(-) diff --git a/app/models/application_model/history_log_base.rb b/app/models/application_model/history_log_base.rb index 743d155b5..3a7a4fbbc 100644 --- a/app/models/application_model/history_log_base.rb +++ b/app/models/application_model/history_log_base.rb @@ -36,22 +36,22 @@ returns result = [ { - :type => 'created', - :object => 'Organization', - :created_by_id => 3, - :created_at => "2013-08-19 20:41:33", + :type => 'created', + :object => 'Organization', + :created_by_id => 3, + :created_at => "2013-08-19 20:41:33", }, { - :type => 'updated', - :object => 'Organization', - :attribute => 'note', - :o_id => 1, - :id_to => nil, - :id_from => nil, - :value_from => "some note", - :value_to => "some other note", - :created_by_id => 3, - :created_at => "2013-08-19 20:41:33", + :type => 'updated', + :object => 'Organization', + :attribute => 'note', + :o_id => 1, + :id_to => nil, + :id_from => nil, + :value_from => "some note", + :value_to => "some other note", + :created_by_id => 3, + :created_at => "2013-08-19 20:41:33", }, ] @@ -97,4 +97,4 @@ returns } end -end +end \ No newline at end of file diff --git a/lib/event_buffer.rb b/lib/event_buffer.rb index 1e3e09ed5..d4a80a356 100644 --- a/lib/event_buffer.rb +++ b/lib/event_buffer.rb @@ -15,4 +15,4 @@ module EventBuffer Thread.current[:event_buffer] = [] end -end +end \ No newline at end of file diff --git a/test/unit/ticket_test.rb b/test/unit/ticket_test.rb index c4674fec7..c1670669e 100644 --- a/test/unit/ticket_test.rb +++ b/test/unit/ticket_test.rb @@ -4,13 +4,13 @@ require 'test_helper' class TicketTest < ActiveSupport::TestCase test 'ticket create' do ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, "ticket created" ) @@ -20,17 +20,17 @@ class TicketTest < ActiveSupport::TestCase # create inbound article article_inbound = Ticket::Article.create( - :ticket_id => ticket.id, - :from => 'some_sender@example.com', - :to => 'some_recipient@example.com', - :subject => 'some subject', - :message_id => 'some@id', - :body => 'some message article_inbound 😍😍😍', - :internal => false, - :sender => Ticket::Article::Sender.where(:name => 'Customer').first, - :type => Ticket::Article::Type.where(:name => 'email').first, - :updated_by_id => 1, - :created_by_id => 1, + :ticket_id => ticket.id, + :from => 'some_sender@example.com', + :to => 'some_recipient@example.com', + :subject => 'some subject', + :message_id => 'some@id', + :body => 'some message article_inbound 😍😍😍', + :internal => false, + :sender => Ticket::Article::Sender.where(:name => 'Customer').first, + :type => Ticket::Article::Type.where(:name => 'email').first, + :updated_by_id => 1, + :created_by_id => 1, ) assert_equal( article_inbound.body, 'some message article_inbound 😍😍😍'.utf8_to_3bytesutf8, 'article_inbound.body verify - inbound' ) @@ -44,15 +44,15 @@ class TicketTest < ActiveSupport::TestCase # create note article article_note = Ticket::Article.create( - :ticket_id => ticket.id, - :from => 'some persion', - :subject => 'some note', - :body => 'some message', - :internal => true, - :sender => Ticket::Article::Sender.where(:name => 'Agent').first, - :type => Ticket::Article::Type.where(:name => 'note').first, - :updated_by_id => 1, - :created_by_id => 1, + :ticket_id => ticket.id, + :from => 'some person', + :subject => 'some note', + :body => 'some message', + :internal => true, + :sender => Ticket::Article::Sender.where(:name => 'Agent').first, + :type => Ticket::Article::Type.where(:name => 'note').first, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) @@ -66,17 +66,17 @@ class TicketTest < ActiveSupport::TestCase # create outbound article sleep 10 article_outbound = Ticket::Article.create( - :ticket_id => ticket.id, - :from => 'some_recipient@example.com', - :to => 'some_sender@example.com', - :subject => 'some subject', - :message_id => 'some@id2', - :body => 'some message 2', - :internal => false, - :sender => Ticket::Article::Sender.where(:name => 'Agent').first, - :type => Ticket::Article::Type.where(:name => 'email').first, - :updated_by_id => 1, - :created_by_id => 1, + :ticket_id => ticket.id, + :from => 'some_recipient@example.com', + :to => 'some_sender@example.com', + :subject => 'some subject', + :message_id => 'some@id2', + :body => 'some message 2', + :internal => false, + :sender => Ticket::Article::Sender.where(:name => 'Agent').first, + :type => Ticket::Article::Type.where(:name => 'email').first, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) @@ -112,15 +112,15 @@ class TicketTest < ActiveSupport::TestCase assert( delete, "ticket destroy_all" ) ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-03-21 09:30:00 UTC', - :updated_at => '2013-03-21 09:30:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-03-21 09:30:00 UTC', + :updated_at => '2013-03-21 09:30:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, "ticket created" ) assert_equal( ticket.escalation_time, nil, 'ticket.escalation_time verify' ) @@ -134,11 +134,11 @@ class TicketTest < ActiveSupport::TestCase "end_of_workday" => "18:00", }, :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_time verify 1' ) @@ -149,19 +149,19 @@ class TicketTest < ActiveSupport::TestCase assert( delete, "sla destroy 1" ) sla = Sla.create( - :name => 'test sla 2', + :name => 'test sla 2', :condition => { "tickets.priority_id" =>["1", "2", "3"] }, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "8:00", "end_of_workday" => "18:00", }, :first_response_time => 60, - :update_time => 120, - :close_time => 180, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 120, + :close_time => 180, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.escalation_time verify 2' ) @@ -258,7 +258,7 @@ class TicketTest < ActiveSupport::TestCase # set close time in time ticket.update_attributes( - :close_time => '2013-03-21 11:30:00 UTC', + :close_time => '2013-03-21 11:30:00 UTC', ) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.escalation_time verify 7' ) @@ -277,7 +277,7 @@ class TicketTest < ActiveSupport::TestCase # set close time over time ticket.update_attributes( - :close_time => '2013-03-21 13:00:00 UTC', + :close_time => '2013-03-21 13:00:00 UTC', ) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.escalation_time verify 8' ) @@ -317,15 +317,15 @@ class TicketTest < ActiveSupport::TestCase assert( delete, "ticket destroy" ) ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :updated_by_id => 1, - :created_by_id => 1, - :created_at => '2013-03-28 23:49:00 UTC', - :updated_at => '2013-03-28 23:49:00 UTC', + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :updated_by_id => 1, + :created_by_id => 1, + :created_at => '2013-03-28 23:49:00 UTC', + :updated_at => '2013-03-28 23:49:00 UTC', ) assert( ticket, "ticket created" ) @@ -335,19 +335,19 @@ class TicketTest < ActiveSupport::TestCase # create inbound article article_inbound = Ticket::Article.create( - :ticket_id => ticket.id, - :from => 'some_sender@example.com', - :to => 'some_recipient@example.com', - :subject => 'some subject', - :message_id => 'some@id', - :body => 'some message', - :internal => false, - :sender => Ticket::Article::Sender.where(:name => 'Customer').first, - :type => Ticket::Article::Type.where(:name => 'email').first, - :updated_by_id => 1, - :created_by_id => 1, - :created_at => '2013-03-28 23:49:00 UTC', - :updated_at => '2013-03-28 23:49:00 UTC', + :ticket_id => ticket.id, + :from => 'some_sender@example.com', + :to => 'some_recipient@example.com', + :subject => 'some subject', + :message_id => 'some@id', + :body => 'some message', + :internal => false, + :sender => Ticket::Article::Sender.where(:name => 'Customer').first, + :type => Ticket::Article::Type.where(:name => 'email').first, + :updated_by_id => 1, + :created_by_id => 1, + :created_at => '2013-03-28 23:49:00 UTC', + :updated_at => '2013-03-28 23:49:00 UTC', ) ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 1, 'ticket.article_count verify - inbound' ) @@ -359,19 +359,19 @@ class TicketTest < ActiveSupport::TestCase # create outbound article article_outbound = Ticket::Article.create( - :ticket_id => ticket.id, - :from => 'some_recipient@example.com', - :to => 'some_sender@example.com', - :subject => 'some subject', - :message_id => 'some@id2', - :body => 'some message 2', - :internal => false, - :sender => Ticket::Article::Sender.where(:name => 'Agent').first, - :type => Ticket::Article::Type.where(:name => 'email').first, - :updated_by_id => 1, - :created_by_id => 1, - :created_at => '2013-03-29 08:00:03 UTC', - :updated_at => '2013-03-29 08:00:03 UTC', + :ticket_id => ticket.id, + :from => 'some_recipient@example.com', + :to => 'some_sender@example.com', + :subject => 'some subject', + :message_id => 'some@id2', + :body => 'some message 2', + :internal => false, + :sender => Ticket::Article::Sender.where(:name => 'Agent').first, + :type => Ticket::Article::Type.where(:name => 'email').first, + :updated_by_id => 1, + :created_by_id => 1, + :created_at => '2013-03-29 08:00:03 UTC', + :updated_at => '2013-03-29 08:00:03 UTC', ) ticket = Ticket.find(ticket.id) @@ -389,15 +389,15 @@ class TicketTest < ActiveSupport::TestCase ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :updated_by_id => 1, - :created_by_id => 1, - :created_at => '2013-03-28 23:49:00 UTC', - :updated_at => '2013-03-28 23:49:00 UTC', + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :updated_by_id => 1, + :created_by_id => 1, + :created_at => '2013-03-28 23:49:00 UTC', + :updated_at => '2013-03-28 23:49:00 UTC', ) assert( ticket, "ticket created" ) @@ -407,18 +407,18 @@ class TicketTest < ActiveSupport::TestCase # create inbound article article_inbound = Ticket::Article.create( - :ticket_id => ticket.id, - :from => 'some_sender@example.com', - :subject => 'some subject', - :message_id => 'some@id', - :body => 'some message', - :internal => false, - :sender => Ticket::Article::Sender.where(:name => 'Customer').first, - :type => Ticket::Article::Type.where(:name => 'phone').first, - :updated_by_id => 1, - :created_by_id => 1, - :created_at => '2013-03-28 23:49:00 UTC', - :updated_at => '2013-03-28 23:49:00 UTC', + :ticket_id => ticket.id, + :from => 'some_sender@example.com', + :subject => 'some subject', + :message_id => 'some@id', + :body => 'some message', + :internal => false, + :sender => Ticket::Article::Sender.where(:name => 'Customer').first, + :type => Ticket::Article::Type.where(:name => 'phone').first, + :updated_by_id => 1, + :created_by_id => 1, + :created_at => '2013-03-28 23:49:00 UTC', + :updated_at => '2013-03-28 23:49:00 UTC', ) ticket = Ticket.find(ticket.id) assert_equal( ticket.article_count, 1, 'ticket.article_count verify - inbound' ) @@ -444,35 +444,35 @@ class TicketTest < ActiveSupport::TestCase assert( delete, "ticket destroy_all" ) ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-03-21 09:30:00 UTC', - :updated_at => '2013-03-21 09:30:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-03-21 09:30:00 UTC', + :updated_at => '2013-03-21 09:30:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, "ticket created" ) assert_equal( ticket.escalation_time, nil, 'ticket.escalation_time verify' ) # set sla's for timezone "Europe/Berlin" wintertime (+1), so UTC times are 8:00-17:00 sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :timezone => 'Europe/Berlin', :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_time verify 1' ) @@ -486,35 +486,35 @@ class TicketTest < ActiveSupport::TestCase delete = ticket.destroy assert( delete, "ticket destroy" ) ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-10-21 09:30:00 UTC', - :updated_at => '2013-10-21 09:30:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-10-21 09:30:00 UTC', + :updated_at => '2013-10-21 09:30:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, "ticket created" ) assert_equal( ticket.escalation_time, nil, 'ticket.escalation_time verify' ) # set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 7:00-16:00 sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :timezone => 'Europe/Berlin', :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-10-21 11:30:00 UTC', 'ticket.escalation_time verify 1' ) @@ -529,35 +529,35 @@ class TicketTest < ActiveSupport::TestCase assert( delete, "sla destroy" ) ticket = Ticket.create( - :title => 'some title äöüß', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-10-21 06:30:00 UTC', - :updated_at => '2013-10-21 06:30:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-10-21 06:30:00 UTC', + :updated_at => '2013-10-21 06:30:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, "ticket created" ) assert_equal( ticket.escalation_time, nil, 'ticket.escalation_time verify' ) # set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 7:00-16:00 sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :timezone => 'Europe/Berlin', :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-10-21 09:00:00 UTC', 'ticket.escalation_time verify 1' ) @@ -575,15 +575,15 @@ class TicketTest < ActiveSupport::TestCase test 'ticket escalation suspend' do ticket = Ticket.create( - :title => 'some title äöüß3', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'new' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-06-04 09:00:00 UTC', - :updated_at => '2013-06-04 09:00:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß3', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'new' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-06-04 09:00:00 UTC', + :updated_at => '2013-06-04 09:00:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, 'ticket created' ) @@ -648,20 +648,20 @@ class TicketTest < ActiveSupport::TestCase # set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 7:00-16:00 sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :timezone => 'Europe/Berlin', :first_response_time => 120, - :update_time => 180, - :close_time => 250, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 250, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) assert_equal( ticket.escalation_time.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.escalation_time verify 1' ) @@ -680,15 +680,15 @@ class TicketTest < ActiveSupport::TestCase # test Ticket created in state pending and closed without reopen or state change ticket = Ticket.create( - :title => 'some title äöüß3', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'pending' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-06-04 09:00:00 UTC', - :updated_at => '2013-06-04 09:00:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß3', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'pending' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-06-04 09:00:00 UTC', + :updated_at => '2013-06-04 09:00:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, 'ticket created' ) @@ -712,19 +712,19 @@ class TicketTest < ActiveSupport::TestCase ) sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) @@ -746,15 +746,15 @@ class TicketTest < ActiveSupport::TestCase # test Ticket created in state pending, changed state to openen, back to pending and closed ticket = Ticket.create( - :title => 'some title äöüß3', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'pending' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-06-04 09:00:00 UTC', - :updated_at => '2013-06-04 09:00:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß3', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'pending' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-06-04 09:00:00 UTC', + :updated_at => '2013-06-04 09:00:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, 'ticket created' ) @@ -807,19 +807,19 @@ class TicketTest < ActiveSupport::TestCase ) sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) @@ -841,15 +841,15 @@ class TicketTest < ActiveSupport::TestCase ### Test Ticket created in state pending, changed state to openen, back to pending and back to open then ### close ticket ticket = Ticket.create( - :title => 'some title äöüß3', - :group => Group.lookup( :name => 'Users'), - :customer_id => 2, - :state => Ticket::State.lookup( :name => 'pending' ), - :priority => Ticket::Priority.lookup( :name => '2 normal' ), - :created_at => '2013-06-04 09:00:00 UTC', - :updated_at => '2013-06-04 09:00:00 UTC', - :updated_by_id => 1, - :created_by_id => 1, + :title => 'some title äöüß3', + :group => Group.lookup( :name => 'Users'), + :customer_id => 2, + :state => Ticket::State.lookup( :name => 'pending' ), + :priority => Ticket::Priority.lookup( :name => '2 normal' ), + :created_at => '2013-06-04 09:00:00 UTC', + :updated_at => '2013-06-04 09:00:00 UTC', + :updated_by_id => 1, + :created_by_id => 1, ) assert( ticket, 'ticket created' ) @@ -917,19 +917,19 @@ class TicketTest < ActiveSupport::TestCase ) sla = Sla.create( - :name => 'test sla 1', + :name => 'test sla 1', :condition => {}, - :data => { + :data => { "Mon"=>"Mon", "Tue"=>"Tue", "Wed"=>"Wed", "Thu"=>"Thu", "Fri"=>"Fri", "Sat"=>"Sat", "Sun"=>"Sun", "beginning_of_workday" => "9:00", "end_of_workday" => "18:00", }, :first_response_time => 120, - :update_time => 180, - :close_time => 240, - :active => true, - :updated_by_id => 1, - :created_by_id => 1, + :update_time => 180, + :close_time => 240, + :active => true, + :updated_by_id => 1, + :created_by_id => 1, ) ticket = Ticket.find(ticket.id) @@ -949,4 +949,4 @@ class TicketTest < ActiveSupport::TestCase assert( delete, "ticket destroy" ) end -end +end \ No newline at end of file