diff options
Diffstat (limited to 'help/test/unit')
-rw-r--r-- | help/test/unit/ticket_test.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/help/test/unit/ticket_test.rb b/help/test/unit/ticket_test.rb index 6b63a23..73a2af5 100644 --- a/help/test/unit/ticket_test.rb +++ b/help/test/unit/ticket_test.rb @@ -23,7 +23,7 @@ class TicketTest < ActiveSupport::TestCase #user = LeapWebUsers::User.create #t.user = user - + #t.email = '' #invalid #assert !t.valid? #t.email = 'blah@blah.com, bb@jjj.org' @@ -40,7 +40,7 @@ class TicketTest < ActiveSupport::TestCase @sample.created_by = 22 #current_user assert @sample.is_creator_validated? end - + =begin # TODO: do once have current_user stuff in order test "code if & only if not creator-validated" do @@ -56,6 +56,14 @@ class TicketTest < ActiveSupport::TestCase end =end + test "finds open tickets sorted by created_at" do + tickets = Ticket.by_is_open_and_created_at. + startkey([true, 0]). + endkey([true, Time.now]) + assert_equal Ticket.by_is_open.key(true).count, tickets.count + end + + end |