Project

General

Profile

Feature #43632 » show_message_no_page_found_recent_page_makro.patch

Florian Walchshofer, 2025-12-31 00:42

View differences:

config/locales/en.yml (working copy)
1462 1462
  reaction_text_x_other_users:
1463 1463
    one: "1 other"
1464 1464
    other: "%{count} others"
1465
  label_no_recent_wiki_pages: "No wiki pages updated within the last %{days} days."
lib/redmine/wiki_formatting/macros.rb (working copy)
249 249
          order("#{WikiContent.table_name}.updated_on desc, id").
250 250
          limit(limit)
251 251

  
252
        return l(:label_no_recent_wiki_pages, days: days_to_list) if pages.empty?
253

  
252 254
        tag.ul do
253 255
          pages.each do |page|
254 256
            concat(
test/unit/lib/redmine/wiki_formatting/macros_test.rb (working copy)
633 633
      end
634 634
    end
635 635
  end
636

  
637
  def test_recent_pages_macro_with_message_no_pages
638
    @project = Project.find(1)
639
    freeze_time do
640
      with_locale :en do
641
        with_settings :text_formatting => 'textile' do
642
          result = textilizable('{{recent_pages(days=3)}}')
643
          expected = I18n.t(:label_no_recent_wiki_pages, days: 3)
644
          assert_select_in result, 'p:first-of-type', text: expected
645
        end
646
      end
647
    end
648
  end
636 649
end
637 650

  
(1-1/2)