From 060230fb94f02f0dd1f6f8836138ec1b18716f17 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 1 Jun 2017 15:43:51 +0100 Subject: [PATCH] Ensure closed changesets appear in the feed, and update some misleading comments. --- .rubocop_todo.yml | 2 +- app/controllers/changeset_controller.rb | 2 +- test/controllers/changeset_controller_test.rb | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c8788ad66..ce7e5d9b2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -64,7 +64,7 @@ Metrics/BlockNesting: # Offense count: 62 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 1781 + Max: 1782 # Offense count: 69 Metrics/CyclomaticComplexity: diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index da066a73a..77ca20fbe 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -248,7 +248,7 @@ class ChangesetController < ApplicationController end ## - # list edits (open changesets) in reverse chronological order + # list non-empty changesets in reverse chronological order def list if request.format == :atom && params[:max_id] redirect_to url_for(params.merge(:max_id => nil)), :status => :moved_permanently diff --git a/test/controllers/changeset_controller_test.rb b/test/controllers/changeset_controller_test.rb index 3e081a079..db0ee5e96 100644 --- a/test/controllers/changeset_controller_test.rb +++ b/test/controllers/changeset_controller_test.rb @@ -2044,9 +2044,10 @@ EOF end ## - # This should display the last 20 changesets closed + # This should display the last 20 non-empty changesets def test_feed changeset = create(:changeset, :num_changes => 1) + closed_changeset = create(:changeset, :closed, :num_changes => 1) _empty_changeset = create(:changeset, :num_changes => 0) get :feed, :format => :atom @@ -2054,7 +2055,7 @@ EOF assert_template "list" assert_equal "application/atom+xml", response.content_type - check_feed_result([changeset]) + check_feed_result([changeset, closed_changeset]) end ## -- 2.39.5