diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index ec8775aae..cc4793a12 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -261,7 +261,7 @@ module Redmine pages.each do |page| concat( tag.li do - html = link_to(h(page.pretty_title), project_wiki_page_path(project, page.title)) + html = link_to(h(page.pretty_title), project_wiki_page_path(page.project, page.title)) html << " (#{time_ago_in_words(page.content.updated_on)})" if is_show_time html end diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index 33e2a76dc..c471be4e8 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -668,7 +668,9 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest # With include_subprojects=true result = textilizable('{{recent_pages(include_subprojects=true)}}') + assert_select_in result, 'ul>li', :text => /Subproject Page/, :count => 1 + assert_select_in result, 'a[href=?]', wiki_page_path(page) end def test_recent_pages_macro_should_not_include_projects_with_wiki_module_disabled