Improved some unit tests.
This commit is contained in:
parent
4a845aae29
commit
e349ab8e48
2 changed files with 35 additions and 25 deletions
|
@ -15,9 +15,11 @@ class HistoryTest < ActiveSupport::TestCase
|
||||||
:title => 'Unit Test 1 (äöüß)!',
|
:title => 'Unit Test 1 (äöüß)!',
|
||||||
:ticket_state_id => Ticket::State.where( :name => 'new' ).first.id,
|
:ticket_state_id => Ticket::State.where( :name => 'new' ).first.id,
|
||||||
:ticket_priority_id => Ticket::Priority.where( :name => '2 normal' ).first.id,
|
:ticket_priority_id => Ticket::Priority.where( :name => '2 normal' ).first.id,
|
||||||
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id
|
:updated_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
|
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
},
|
},
|
||||||
:article => {
|
:article => {
|
||||||
|
:updated_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
:ticket_article_type_id => Ticket::Article::Type.where(:name => 'phone' ).first.id,
|
:ticket_article_type_id => Ticket::Article::Type.where(:name => 'phone' ).first.id,
|
||||||
:ticket_article_sender_id => Ticket::Article::Sender.where(:name => 'Customer' ).first.id,
|
:ticket_article_sender_id => Ticket::Article::Sender.where(:name => 'Customer' ).first.id,
|
||||||
|
@ -71,10 +73,12 @@ class HistoryTest < ActiveSupport::TestCase
|
||||||
:title => 'Unit Test 2 (äöüß)!',
|
:title => 'Unit Test 2 (äöüß)!',
|
||||||
:ticket_state_id => Ticket::State.where( :name => 'new' ).first.id,
|
:ticket_state_id => Ticket::State.where( :name => 'new' ).first.id,
|
||||||
:ticket_priority_id => Ticket::Priority.where( :name => '2 normal' ).first.id,
|
:ticket_priority_id => Ticket::Priority.where( :name => '2 normal' ).first.id,
|
||||||
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id
|
:updated_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
|
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
},
|
},
|
||||||
:article => {
|
:article => {
|
||||||
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
:created_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
|
:updated_by_id => User.where( :login => 'nicole.braun@zammad.org' ).first.id,
|
||||||
:ticket_article_type_id => Ticket::Article::Type.where(:name => 'phone' ).first.id,
|
:ticket_article_type_id => Ticket::Article::Type.where(:name => 'phone' ).first.id,
|
||||||
:ticket_article_sender_id => Ticket::Article::Sender.where(:name => 'Customer' ).first.id,
|
:ticket_article_sender_id => Ticket::Article::Sender.where(:name => 'Customer' ).first.id,
|
||||||
:from => 'Unit Test <unittest@example.com>',
|
:from => 'Unit Test <unittest@example.com>',
|
||||||
|
@ -129,7 +133,6 @@ class HistoryTest < ActiveSupport::TestCase
|
||||||
test[:ticket_create][:article][:ticket_id] = ticket.id
|
test[:ticket_create][:article][:ticket_id] = ticket.id
|
||||||
article = Ticket::Article.create( test[:ticket_create][:article] )
|
article = Ticket::Article.create( test[:ticket_create][:article] )
|
||||||
|
|
||||||
|
|
||||||
assert_equal( ticket.class.to_s, 'Ticket' )
|
assert_equal( ticket.class.to_s, 'Ticket' )
|
||||||
assert_equal( article.class.to_s, 'Ticket::Article' )
|
assert_equal( article.class.to_s, 'Ticket::Article' )
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => 'Lastname',
|
:lastname => 'Lastname',
|
||||||
:email => 'some@example.com',
|
:email => 'some@example.com',
|
||||||
:login => 'some@example.com',
|
:login => 'some@example.com',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
@ -25,6 +26,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => '',
|
:lastname => '',
|
||||||
:email => 'some@example.com',
|
:email => 'some@example.com',
|
||||||
:login => 'some@example.com',
|
:login => 'some@example.com',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
@ -40,6 +42,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => nil,
|
:lastname => nil,
|
||||||
:email => 'some@example.com',
|
:email => 'some@example.com',
|
||||||
:login => 'some@example.com',
|
:login => 'some@example.com',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
@ -55,6 +58,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => '',
|
:lastname => '',
|
||||||
:email => 'some@example.com',
|
:email => 'some@example.com',
|
||||||
:login => 'some@example.com',
|
:login => 'some@example.com',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
@ -70,6 +74,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => '',
|
:lastname => '',
|
||||||
:email => 'firstname.lastname@example.com',
|
:email => 'firstname.lastname@example.com',
|
||||||
:login => 'login',
|
:login => 'login',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
@ -85,6 +90,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => '',
|
:lastname => '',
|
||||||
:email => 'FIRSTNAME.lastname@example.com',
|
:email => 'FIRSTNAME.lastname@example.com',
|
||||||
:login => 'login',
|
:login => 'login',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
@ -100,6 +106,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
:lastname => nil,
|
:lastname => nil,
|
||||||
:email => 'FIRSTNAME.lastname@example.com',
|
:email => 'FIRSTNAME.lastname@example.com',
|
||||||
:login => 'login',
|
:login => 'login',
|
||||||
|
:updated_by_id => 1,
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
},
|
},
|
||||||
:create_verify => {
|
:create_verify => {
|
||||||
|
|
Loading…
Reference in a new issue