summaryrefslogtreecommitdiff
path: root/help/test/unit
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-11-27 16:36:00 -0800
committerjessib <jessib@leap.se>2012-11-27 16:36:00 -0800
commite78b4e7af81d6350b9064a977e1990d9a6f1408c (patch)
tree67f8458400a598c3ce1090ac99703f25b61fc02e /help/test/unit
parent5e3b32495fdb359a43f2519646905393ec10a598 (diff)
test changes that will fail, but should fail until we fix model.
Diffstat (limited to 'help/test/unit')
-rw-r--r--help/test/unit/ticket_test.rb8
1 files changed, 7 insertions, 1 deletions
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