From: Tom Hughes Date: Fri, 27 Oct 2017 18:45:32 +0000 (+0100) Subject: Avoid using rinku's auto_link helper X-Git-Tag: live~3863 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/1c77d2432e17829a790d3e2dbf2a9267833ec1f0 Avoid using rinku's auto_link helper It's currently broken (https://github.com/vmg/rinku/issues/70) and in case our own linkify has some additional customisations. --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 41bd7c80a..b4104079c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -82,7 +82,7 @@ Metrics/BlockNesting: # Offense count: 63 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 1790 + Max: 1796 # Offense count: 71 Metrics/CyclomaticComplexity: diff --git a/app/views/changeset/list.atom.builder b/app/views/changeset/list.atom.builder index ace586ae5..a3b7a2240 100644 --- a/app/views/changeset/list.atom.builder +++ b/app/views/changeset/list.atom.builder @@ -62,7 +62,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, td.table :cellpadding => "0" do |table| changeset.tags.sort.each do |tag| table.tr do |tr| - tr.td << "#{h(tag[0])} = #{auto_link(h(tag[1]))}" + tr.td << "#{h(tag[0])} = #{linkify(h(tag[1]))}" end end end diff --git a/test/controllers/changeset_controller_test.rb b/test/controllers/changeset_controller_test.rb index b1aa79810..a0f7960c3 100644 --- a/test/controllers/changeset_controller_test.rb +++ b/test/controllers/changeset_controller_test.rb @@ -2060,6 +2060,8 @@ CHANGESET # This should display the last 20 non-empty changesets def test_feed changeset = create(:changeset, :num_changes => 1) + create(:changeset_tag, :changeset => changeset) + create(:changeset_tag, :changeset => changeset, :k => "website", :v => "http://example.com/") closed_changeset = create(:changeset, :closed, :num_changes => 1) _empty_changeset = create(:changeset, :num_changes => 0) @@ -2075,6 +2077,8 @@ CHANGESET # This should display the last 20 changesets closed in a specific area def test_feed_bbox changeset = create(:changeset, :num_changes => 1, :min_lat => 5 * GeoRecord::SCALE, :min_lon => 5 * GeoRecord::SCALE, :max_lat => 5 * GeoRecord::SCALE, :max_lon => 5 * GeoRecord::SCALE) + create(:changeset_tag, :changeset => changeset) + create(:changeset_tag, :changeset => changeset, :k => "website", :v => "http://example.com/") closed_changeset = create(:changeset, :closed, :num_changes => 1, :min_lat => 5 * GeoRecord::SCALE, :min_lon => 5 * GeoRecord::SCALE, :max_lat => 5 * GeoRecord::SCALE, :max_lon => 5 * GeoRecord::SCALE) _elsewhere_changeset = create(:changeset, :num_changes => 1, :min_lat => -5 * GeoRecord::SCALE, :min_lon => -5 * GeoRecord::SCALE, :max_lat => -5 * GeoRecord::SCALE, :max_lon => -5 * GeoRecord::SCALE) _empty_changeset = create(:changeset, :num_changes => 0, :min_lat => -5 * GeoRecord::SCALE, :min_lon => -5 * GeoRecord::SCALE, :max_lat => -5 * GeoRecord::SCALE, :max_lon => -5 * GeoRecord::SCALE) @@ -2092,6 +2096,8 @@ CHANGESET def test_feed_user user = create(:user) changesets = create_list(:changeset, 3, :user => user, :num_changes => 4) + create(:changeset_tag, :changeset => changesets[1]) + create(:changeset_tag, :changeset => changesets[1], :k => "website", :v => "http://example.com/") _other_changeset = create(:changeset) get :feed, :params => { :format => :atom, :display_name => user.display_name }