From b3f4637a42ef56cf96cec6a907f691d480e66211 Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Sat, 26 Dec 2009 21:29:43 +0000 Subject: [PATCH] Fixed copy-n-paste bug in querying for closed changesets and added a test for it. --- app/controllers/changeset_controller.rb | 2 +- test/functional/changeset_controller_test.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index 83ee16f53..79000c685 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -427,7 +427,7 @@ private # query changesets which are closed # ('closed at' time has passed or changes limit is hit) def conditions_closed(closed) - return closed.nil? ? nil : ['closed_at < ? and num_changes > ?', + return closed.nil? ? nil : ['closed_at < ? or num_changes > ?', Time.now.getutc, Changeset::MAX_ELEMENTS] end diff --git a/test/functional/changeset_controller_test.rb b/test/functional/changeset_controller_test.rb index 76ec0866a..befa8192a 100644 --- a/test/functional/changeset_controller_test.rb +++ b/test/functional/changeset_controller_test.rb @@ -1382,6 +1382,10 @@ EOF get :query, :open => 'true' assert_response :success, "can't get changesets by open-ness" assert_changesets [1,2,4] + + get :query, :closed => 'true' + assert_response :success, "can't get changesets by closed-ness" + assert_changesets [3,5,6,7] end ## -- 2.39.5