Project

General

Profile

Defect #40655 » 40655.patch

Go MAEDA, 2024-06-06 12:38

View differences:

app/views/wiki/show.html.erb
85 85
<p class="wiki-update-info">
86 86
  <% if User.current.allowed_to?(:view_wiki_edits, @project) %>
87 87
    <%= wiki_content_update_info(@content) %>
88
    · <%= link_to l(:label_x_revisions, :count => @content.version), {:action => 'history', :id => @page.title} %>
88
    · <%= link_to l(:label_x_revisions, :count => @page.content.versions.size), {:action => 'history', :id => @page.title} %>
89 89
  <% end %>
90 90
  <% if @page.protected? %>
91 91
    <span class="badge badge-status-locked"><%= l('status_locked') %></span>
test/functional/wiki_controller_test.rb
233 233
    end
234 234
  end
235 235

  
236
  def test_show_should_display_revisions_count
237
    # To ensure that the number of versions is correctly displayed instead of
238
    # the last version number of the wiki page, make a situation where the
239
    # those two numbers are different.
240
    content_versions = WikiContentVersion.where(page_id: 1)
241
    content_versions.first.destroy
242
    assert 3, content_versions.last.version
243
    assert 2, content_versions.size
244

  
245
    get :show, :params => {:project_id => 1, :id => 'CookBook_documentation'}
246
    assert_response :success
247
    assert_select 'a[href=?]', '/projects/1/wiki/CookBook_documentation/history', :text => /2 revisions/
248
  end
249

  
236 250
  def test_get_new
237 251
    @request.session[:user_id] = 2
238 252

  
(3-3/3)