Fixed tests.
This commit is contained in:
parent
e5ac9519e7
commit
3270ea7c7e
2 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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' => {
|
||||
|
|
Loading…
Reference in a new issue