From 04e7b18869eed8824ffd33ebc69dc99e0aab13e0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 11 Apr 2012 17:02:21 +0000 Subject: [PATCH] Fixed that export links include page parameter. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9382 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/views/other_formats_builder.rb | 2 +- test/functional/issues_controller_test.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/redmine/views/other_formats_builder.rb b/lib/redmine/views/other_formats_builder.rb index 71eb1e09c..8e0a59861 100644 --- a/lib/redmine/views/other_formats_builder.rb +++ b/lib/redmine/views/other_formats_builder.rb @@ -23,7 +23,7 @@ module Redmine end def link_to(name, options={}) - url = { :format => name.to_s.downcase }.merge(options.delete(:url) || {}) + url = { :format => name.to_s.downcase }.merge(options.delete(:url) || {}).except('page') caption = options.delete(:caption) || name html_options = { :class => name.to_s.downcase, :rel => 'nofollow' }.merge(options) @view.content_tag('span', @view.link_to(caption, url, html_options)) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 9bb600eff..484880cc7 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -305,6 +305,15 @@ class IssuesControllerTest < ActionController::TestCase assert_response :success end + def test_index_should_omit_page_param_in_export_links + get :index, :page => 2 + assert_response :success + assert_select 'a.atom[href=/issues.atom]' + assert_select 'a.csv[href=/issues.csv]' + assert_select 'a.pdf[href=/issues.pdf]' + assert_select 'form#csv-export-form[action=/issues.csv]' + end + def test_index_csv get :index, :format => 'csv' assert_response :success