]> source.dussan.org Git - redmine.git/commitdiff
Fixed that export links include page parameter.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 11 Apr 2012 17:02:21 +0000 (17:02 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 11 Apr 2012 17:02:21 +0000 (17:02 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9382 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/views/other_formats_builder.rb
test/functional/issues_controller_test.rb

index 71eb1e09c24141d4ac288d8f91d994a454d34b62..8e0a59861799d9e527e97a27a30df4ad6f83cf1e 100644 (file)
@@ -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))
index 9bb600eff7dfa72ec66e4f573d17ddf258c10fe5..484880cc70228953a6ad133e34cb3dafa56ac901 100644 (file)
@@ -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