Fixed expected results.
This commit is contained in:
parent
e5a9dc8b78
commit
1005219a0b
1 changed files with 27 additions and 27 deletions
|
@ -369,41 +369,19 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
||||||
# check changed attributes
|
# check changed attributes
|
||||||
human_changes = bg.human_changes(agent1,ticket1)
|
human_changes = bg.human_changes(agent1,ticket1)
|
||||||
assert( human_changes['Priority'], 'Check if attributes translated based on ObjectManager::Attribute' )
|
assert( human_changes['Priority'], 'Check if attributes translated based on ObjectManager::Attribute' )
|
||||||
assert_equal( '1 low', human_changes['Priority'][0] )
|
assert_equal( 'i18n(1 low)', human_changes['Priority'][0] )
|
||||||
assert_equal( '2 normal', human_changes['Priority'][1] )
|
assert_equal( 'i18n(2 normal)', human_changes['Priority'][1] )
|
||||||
assert_not( human_changes['priority_id'] )
|
assert_not( human_changes['priority_id'] )
|
||||||
|
|
||||||
# en template
|
# en template
|
||||||
template = bg.template_update(agent1, ticket1, article, human_changes)
|
|
||||||
assert( template[:subject] )
|
|
||||||
assert( template[:body] )
|
|
||||||
assert_match( /Priority/, template[:body] )
|
|
||||||
assert_match( /1 low/, template[:body] )
|
|
||||||
assert_match( /3 normal/, template[:body] )
|
|
||||||
|
|
||||||
# en notification
|
|
||||||
body = NotificationFactory.build(
|
|
||||||
:locale => agent1.preferences[:locale],
|
|
||||||
:string => template[:body],
|
|
||||||
:objects => {
|
|
||||||
:ticket => ticket1,
|
|
||||||
:article => article,
|
|
||||||
:recipient => agent1,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
assert_match( /Priority/, body )
|
|
||||||
assert_match( /1 low/, body )
|
|
||||||
assert_match( /3 normal/, body )
|
|
||||||
|
|
||||||
# de template
|
|
||||||
template = bg.template_update(agent2, ticket1, article, human_changes)
|
template = bg.template_update(agent2, ticket1, article, human_changes)
|
||||||
assert( template[:subject] )
|
assert( template[:subject] )
|
||||||
assert( template[:body] )
|
assert( template[:body] )
|
||||||
assert_match( /Priority/, template[:body] )
|
assert_match( /Priority/, template[:body] )
|
||||||
assert_match( /1 low/, template[:body] )
|
assert_match( /1 low/, template[:body] )
|
||||||
assert_match( /3 normal/, template[:body] )
|
assert_match( /2 normal/, template[:body] )
|
||||||
|
|
||||||
# de notification
|
# en notification
|
||||||
body = NotificationFactory.build(
|
body = NotificationFactory.build(
|
||||||
:locale => agent2.preferences[:locale],
|
:locale => agent2.preferences[:locale],
|
||||||
:string => template[:body],
|
:string => template[:body],
|
||||||
|
@ -413,9 +391,31 @@ class TicketNotificationTest < ActiveSupport::TestCase
|
||||||
:recipient => agent2,
|
:recipient => agent2,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
assert_match( /Priority/, body )
|
||||||
|
assert_match( /1 low/, body )
|
||||||
|
assert_match( /2 normal/, body )
|
||||||
|
|
||||||
|
# de template
|
||||||
|
template = bg.template_update(agent1, ticket1, article, human_changes)
|
||||||
|
assert( template[:subject] )
|
||||||
|
assert( template[:body] )
|
||||||
|
assert_match( /Priority/, template[:body] )
|
||||||
|
assert_match( /1 low/, template[:body] )
|
||||||
|
assert_match( /2 normal/, template[:body] )
|
||||||
|
|
||||||
|
# de notification
|
||||||
|
body = NotificationFactory.build(
|
||||||
|
:locale => agent1.preferences[:locale],
|
||||||
|
:string => template[:body],
|
||||||
|
:objects => {
|
||||||
|
:ticket => ticket1,
|
||||||
|
:article => article,
|
||||||
|
:recipient => agent1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
assert_match( /Priorität/, body )
|
assert_match( /Priorität/, body )
|
||||||
assert_match( /1 gering/, body )
|
assert_match( /1 niedrig/, body )
|
||||||
assert_match( /3 normal/, body )
|
assert_match( /3 normal/, body )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue