Sort /pages alphabetically
Previously, the 'All Pages' view was not sorted alphabetically. We need to sort on the lowercase version of the page names so that lowercase names do not end up at the bottom of the list and are instead mixed in alphabetically, as they should be. Patches test/test_latest_changes_view.rb to include changes needed to test alphabetical sorting.
This commit is contained in:
@@ -450,6 +450,7 @@ module Precious
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
||||
@results = wiki.pages
|
||||
@results += wiki.files if settings.wiki_options[:show_all]
|
||||
@results = @results.sort_by { |p| p.name.downcase } # Sort Results alphabetically, fixes 922
|
||||
@ref = wiki.ref
|
||||
mustache :pages
|
||||
end
|
||||
|
||||
@@ -8,3 +8,4 @@ cfea406f5f77afc7fb673a43e97721234385b1bd 629aa678272b017a4d136d35e77ac94d80b08dc
|
||||
629aa678272b017a4d136d35e77ac94d80b08dc2 7d6aeab8b84c895f21f6c66b84a457b0fced9693 Daniel Kimsey <dekimsey@ufl.edu> 1352501984 -0500 push
|
||||
7d6aeab8b84c895f21f6c66b84a457b0fced9693 563cc3701db990caf63e4ce9c3697a062890ca48 James Dabbs <jamesdabbs@gmail.com> 1361843315 -0500 push
|
||||
563cc3701db990caf63e4ce9c3697a062890ca48 874f597a5659b4c3b153674ea04e406ff393975e Charles Pence <charles@charlespence.net> 1363478075 -0400 push
|
||||
874f597a5659b4c3b153674ea04e406ff393975e 7bdfe65face6f7cf9877d8c1d8c1dd974a63745e Nathan Lowe <techwiz96@gmail.com> 1421012322 -0500 push
|
||||
|
||||
@@ -8,3 +8,4 @@ cfea406f5f77afc7fb673a43e97721234385b1bd 629aa678272b017a4d136d35e77ac94d80b08dc
|
||||
629aa678272b017a4d136d35e77ac94d80b08dc2 7d6aeab8b84c895f21f6c66b84a457b0fced9693 Daniel Kimsey <dekimsey@ufl.edu> 1352501984 -0500 push
|
||||
7d6aeab8b84c895f21f6c66b84a457b0fced9693 563cc3701db990caf63e4ce9c3697a062890ca48 James Dabbs <jamesdabbs@gmail.com> 1361843315 -0500 push
|
||||
563cc3701db990caf63e4ce9c3697a062890ca48 874f597a5659b4c3b153674ea04e406ff393975e Charles Pence <charles@charlespence.net> 1363478075 -0400 push
|
||||
874f597a5659b4c3b153674ea04e406ff393975e 7bdfe65face6f7cf9877d8c1d8c1dd974a63745e Nathan Lowe <techwiz96@gmail.com> 1421012322 -0500 push
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x
|
||||
йA
|
||||
─ пж²Б╥
|
||||
@@ -1 +1 @@
|
||||
874f597a5659b4c3b153674ea04e406ff393975e
|
||||
7bdfe65face6f7cf9877d8c1d8c1dd974a63745e
|
||||
|
||||
@@ -619,6 +619,7 @@ context "Frontend with lotr" do
|
||||
assert !body.include?("Boromir"), "/pages should NOT include the page 'Boromir'"
|
||||
assert body.include?("Mordor"), "/pages should include the folder 'Mordor'"
|
||||
assert !body.include?("Eye Of Sauron"), "/pages should NOT include the page 'Eye Of Sauron'"
|
||||
assert !body.match(/(Zamin).+(roast\-mutton)/m), "/pages should be sorted alphabetically"
|
||||
end
|
||||
|
||||
test "/pages/Mordor/" do
|
||||
|
||||
@@ -19,9 +19,10 @@ context "Precious::Views::LatestChanges" do
|
||||
test "displays_latest_changes" do
|
||||
get('/latest_changes')
|
||||
body = last_response.body
|
||||
|
||||
assert body.include?('<span class="username">Charles Pence</span>'), "/latest_changes should include the Author Charles Pence"
|
||||
assert body.include?('60f12f4'), "/latest_changes should include the :latest_changes_count commit"
|
||||
assert !body.include?('0ed8cbe'), "/latest_changes should not include more than latest_changes_count commits"
|
||||
assert body.include?('a8ad3c0'), "/latest_changes should include the :latest_changes_count commit"
|
||||
assert !body.include?('60f12f4'), "/latest_changes should not include more than latest_changes_count commits"
|
||||
assert body.include?('<a href="Data-Two.csv/874f597a5659b4c3b153674ea04e406ff393975e">Data-Two.csv</a>'), "/latest_changes include links to modified files in #{body}"
|
||||
assert body.include?('<a href="Hobbit/874f597a5659b4c3b153674ea04e406ff393975e">Hobbit.md</a>'), "/latest_changes should include links to modified pages in #{body}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user