Added explicit sorting of authors and pages in Authors page

This commit is contained in:
Alexey Verkhovsky 2005-05-29 14:18:05 +00:00
parent c00d1ca0f1
commit a1527f60b0
3 changed files with 7 additions and 4 deletions

View file

@ -42,7 +42,7 @@ class WikiController < ApplicationController
# Within a single web ---------------------------------------------------------
def authors
@authors = @web.select.authors
@authors = @web.select.authors.sort
end
def export_html

View file

@ -5,7 +5,7 @@
<li>
<%= link_to_page author %>
co- or authored:
<%= @web.select.pages_authored_by(author).collect { |page| link_to_page(page.name) }.join ', ' %>
<%= @web.select.pages_authored_by(author).collect { |page| link_to_page(page.name) }.sort.join ', ' %>
</li>
<% end %>
</ul>

View file

@ -192,13 +192,16 @@ class E2EInstikiTest < Test::Unit::TestCase
ie.link(:text, 'Authors').click
expected_authors =
'Anonymous Coward\? co- or authored: Test Edit Page, Another Wiki Page, Home Page.*' +
'Another Author co- or authored: Test Edit Page, Another Author.*' +
'Anonymous Coward\? co- or authored: Another Wiki Page, Home Page, Test Edit Page.*' +
'Another Author co- or authored: Another Author, Test Edit Page.*' +
'Author\? co- or authored: Test Edit Page'
assert_match Regexp.new(expected_authors, Regexp::MULTILINE), ie.text
ie.link(:text, 'Another Author').click
assert_equal url(:show, 'Another Author'), ie.url
ie.back
ie.link(:text, 'Test Edit Page').click
assert_equal url(:show, 'TestEditPage'), ie.url
end
private