]> source.dussan.org Git - redmine.git/commitdiff
Reversed order of priorities on the issue summary page (#11205).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 20 Jun 2012 19:24:58 +0000 (19:24 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 20 Jun 2012 19:24:58 +0000 (19:24 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9879 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/reports_controller.rb
test/functional/reports_controller_test.rb

index 65f01978d1ea366a9db3b8b6a5a577928095d377..c9e9a39fa5d393f8090d83ad7dae76aeee26d211 100644 (file)
@@ -22,7 +22,7 @@ class ReportsController < ApplicationController
   def issue_report
     @trackers = @project.trackers
     @versions = @project.shared_versions.sort
-    @priorities = IssuePriority.all
+    @priorities = IssuePriority.all.reverse
     @categories = @project.issue_categories
     @assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
     @authors = @project.users.sort
@@ -53,7 +53,7 @@ class ReportsController < ApplicationController
       @report_title = l(:field_version)
     when "priority"
       @field = "priority_id"
-      @rows = IssuePriority.all
+      @rows = IssuePriority.all.reverse
       @data = Issue.by_priority(@project)
       @report_title = l(:field_priority)
     when "category"
index b9954d34dce11e255803d3f01f82a97e8744cf71..c44a8a229a455634feb78f17e242c5c7bf5cb071 100644 (file)
@@ -38,9 +38,11 @@ class ReportsControllerTest < ActionController::TestCase
     assert_template 'issue_report'
 
     [:issues_by_tracker, :issues_by_version, :issues_by_category, :issues_by_assigned_to,
-     :issues_by_author, :issues_by_subproject].each do |ivar|
+     :issues_by_author, :issues_by_subproject, :issues_by_priority].each do |ivar|
       assert_not_nil assigns(ivar)
     end
+
+    assert_equal IssuePriority.all.reverse, assigns(:priorities)
   end
 
   def test_get_issue_report_details
@@ -56,6 +58,11 @@ class ReportsControllerTest < ActionController::TestCase
     end
   end
 
+  def test_get_issue_report_details_by_priority
+    get :issue_report_details, :id => 1, :detail => 'priority'
+    assert_equal IssuePriority.all.reverse, assigns(:rows)
+  end
+
   def test_get_issue_report_details_with_an_invalid_detail
     get :issue_report_details, :id => 1, :detail => 'invalid'