Small improvements.
This commit is contained in:
parent
ae203f542a
commit
b864eb9ad6
2 changed files with 20 additions and 8 deletions
|
@ -349,13 +349,13 @@ class ActivityStreamTest < ActiveSupport::TestCase
|
|||
def activity_stream_check( activity_stream_list, checks )
|
||||
puts 'AS ' + activity_stream_list.inspect
|
||||
checks.each { |check_item|
|
||||
# puts '+++++++++++'
|
||||
# puts check_item.inspect
|
||||
puts '+++++++++++'
|
||||
puts check_item.inspect
|
||||
match = false
|
||||
activity_stream_list.each { |item|
|
||||
next if match
|
||||
# puts '--------'
|
||||
# puts item.inspect
|
||||
puts '--------'
|
||||
puts item.inspect
|
||||
# puts item.object
|
||||
next if item['object'] != check_item[:object]
|
||||
next if item['type'] != check_item[:type]
|
||||
|
|
|
@ -3,6 +3,16 @@ require 'test_helper'
|
|||
|
||||
class NotificationFactoryTest < ActiveSupport::TestCase
|
||||
test 'notifications' do
|
||||
ticket = Ticket.create(
|
||||
:title => 'some title äöüß',
|
||||
:group => Group.lookup( :name => 'Users'),
|
||||
:customer_id => 2,
|
||||
:ticket_state => Ticket::State.lookup( :name => 'new' ),
|
||||
:ticket_priority => Ticket::Priority.lookup( :name => '2 normal' ),
|
||||
:updated_by_id => 1,
|
||||
:created_by_id => 1,
|
||||
)
|
||||
|
||||
tests = [
|
||||
{
|
||||
:locale => 'en',
|
||||
|
@ -39,12 +49,14 @@ class NotificationFactoryTest < ActiveSupport::TestCase
|
|||
result = NotificationFactory.build(
|
||||
:string => test[:string],
|
||||
:objects => {
|
||||
:ticket => Ticket.find(1),
|
||||
:ticket => ticket,
|
||||
:recipient => User.find(2),
|
||||
},
|
||||
:locale => test[:locale]
|
||||
)
|
||||
assert_equal( result, test[:result], "verify result" )
|
||||
}
|
||||
|
||||
ticket.destroy
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue