Fixed tests.

This commit is contained in:
Martin Edenhofer 2015-10-12 23:31:33 +02:00
parent e5ac9519e7
commit 3270ea7c7e
2 changed files with 7 additions and 7 deletions

View file

@ -414,7 +414,7 @@ condition example
end
bind_params.push time
elsif selector['operator'] == 'within next (relative)'
query += "#{attribute} >= ?"
query += "#{attribute} <= ?"
time = nil
if selector['range'] == 'minute'
time = Time.zone.now + selector['value'].to_i.minutes

View file

@ -303,16 +303,16 @@ class TicketSelectorTest < ActiveSupport::TestCase
},
}
ticket_count, tickets = Ticket.selectors(condition, 10, agent1)
assert_equal( ticket_count, 0 )
assert_equal( ticket_count, 2 )
ticket_count, tickets = Ticket.selectors(condition, 10, agent2)
assert_equal( ticket_count, 0 )
ticket_count, tickets = Ticket.selectors(condition, 10, customer1)
assert_equal( ticket_count, 0 )
assert_equal( ticket_count, 1 )
ticket_count, tickets = Ticket.selectors(condition, 10, customer2)
assert_equal( ticket_count, 0 )
assert_equal( ticket_count, 1 )
condition = {
'ticket.group_id' => {
@ -461,16 +461,16 @@ class TicketSelectorTest < ActiveSupport::TestCase
},
}
ticket_count, tickets = Ticket.selectors(condition, 10, agent1)
assert_equal( ticket_count, 0 )
assert_equal( ticket_count, 2 )
ticket_count, tickets = Ticket.selectors(condition, 10, agent2)
assert_equal( ticket_count, 0 )
ticket_count, tickets = Ticket.selectors(condition, 10, customer1)
assert_equal( ticket_count, 0 )
assert_equal( ticket_count, 1 )
ticket_count, tickets = Ticket.selectors(condition, 10, customer2)
assert_equal( ticket_count, 0 )
assert_equal( ticket_count, 1 )
condition = {
'ticket.group_id' => {