From: Matt Amos Date: Sat, 26 Dec 2009 21:29:43 +0000 (+0000) Subject: Fixed copy-n-paste bug in querying for closed changesets and added a test for it. X-Git-Tag: live~6468 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/b3f4637a42ef56cf96cec6a907f691d480e66211 Fixed copy-n-paste bug in querying for closed changesets and added a test for it. --- 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 ##