From e78b4e7af81d6350b9064a977e1990d9a6f1408c Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 27 Nov 2012 16:36:00 -0800 Subject: test changes that will fail, but should fail until we fix model. --- help/test/unit/ticket_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'help') diff --git a/help/test/unit/ticket_test.rb b/help/test/unit/ticket_test.rb index 8d6d197..691597a 100644 --- a/help/test/unit/ticket_test.rb +++ b/help/test/unit/ticket_test.rb @@ -59,7 +59,7 @@ class TicketTest < ActiveSupport::TestCase test "finds open tickets sorted by created_at" do tickets = Ticket.by_is_open_and_created_at. startkey([true, 0]). - endkey([true, Time.now]) + endkey([true, Time.now + 10.hours]) # some tickets were created in the future assert_equal Ticket.by_is_open.key(true).count, tickets.count end @@ -77,6 +77,12 @@ class TicketTest < ActiveSupport::TestCase assert_equal 1, testticket.reload.comments.count assert_equal [testticket], Ticket.by_commented_by.key('123').all; + comment = TicketComment.new :body => "another comment", :posted_by => "123" + testticket.comments << comment + testticket.save + #this will now fail, as Ticket.by_commented_by will return 2 copies of the same ticket as both of the ticket's comments match + assert_equal [testticket], Ticket.by_commented_by.key('123').all; + testticket.destroy assert_equal [], Ticket.by_commented_by.key('123').all; end -- cgit v1.2.3