From 53ad42e1d8417b93500c7d4a3108c5c48c7edc61 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 21 Mar 2011 18:10:04 +0000 Subject: [PATCH] Fixed: atom links on wiki index broken by r4266. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5186 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/wiki/date_index.html.erb | 4 ++-- app/views/wiki/index.html.erb | 4 ++-- test/functional/wiki_controller_test.rb | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/wiki/date_index.html.erb b/app/views/wiki/date_index.html.erb index 65af6084e..a0327cf4c 100644 --- a/app/views/wiki/date_index.html.erb +++ b/app/views/wiki/date_index.html.erb @@ -23,11 +23,11 @@ <% unless @pages.empty? %> <% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %> + <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %> <%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %> <% end %> <% end %> <% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %> +<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %> <% end %> diff --git a/app/views/wiki/index.html.erb b/app/views/wiki/index.html.erb index 5f962468a..d42ee9662 100644 --- a/app/views/wiki/index.html.erb +++ b/app/views/wiki/index.html.erb @@ -16,11 +16,11 @@ <% unless @pages.empty? %> <% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %> + <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %> <%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %> <% end %> <% end %> <% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %> +<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %> <% end %> diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 37cae481e..397018f54 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -387,6 +387,11 @@ class WikiControllerTest < ActionController::TestCase :child => { :tag => 'li', :child => { :tag => 'a', :attributes => { :href => '/projects/ecookbook/wiki/Another_page' }, :content => 'Another page' } } end + + def test_index_should_include_atom_link + get :index, :project_id => 'ecookbook' + assert_tag 'a', :attributes => { :href => '/projects/ecookbook/activity.atom?show_wiki_edits=1'} + end context "GET :export" do context "with an authorized user to export the wiki" do @@ -426,6 +431,9 @@ class WikiControllerTest < ActionController::TestCase should_assign_to :pages_by_date should_render_template 'wiki/date_index' + should "include atom link" do + assert_tag 'a', :attributes => { :href => '/projects/ecookbook/activity.atom?show_wiki_edits=1'} + end end def test_not_found -- 2.39.5