summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/project.rb1
-rw-r--r--test/functional/reports_controller_test.rb2
-rw-r--r--test/unit/project_test.rb2
3 files changed, 5 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 9f9656976..08fdefabd 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -492,6 +492,7 @@ class Project < ActiveRecord::Base
def rolled_up_statuses
issue_status_ids = WorkflowTransition.
where(:tracker_id => rolled_up_trackers.map(&:id)).
+ where('old_status_id <> new_status_id').
distinct.
pluck(:old_status_id, :new_status_id).
flatten.
diff --git a/test/functional/reports_controller_test.rb b/test/functional/reports_controller_test.rb
index 67ea188f2..9f6624f6a 100644
--- a/test/functional/reports_controller_test.rb
+++ b/test/functional/reports_controller_test.rb
@@ -107,6 +107,8 @@ class ReportsControllerTest < Redmine::ControllerTest
WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 5)
WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 6)
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 3, :new_status_id => 3)
+
with_settings :display_subprojects_issues => '0' do
get(:issue_report_details, :params => {:id => 1, :detail => 'tracker'})
end
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index eacbf0c92..291ce2ff3 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -534,6 +534,8 @@ class ProjectTest < ActiveSupport::TestCase
WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 3)
WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 3)
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 5, :new_status_id => 5)
+ WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 5, :new_status_id => 5)
assert_kind_of IssueStatus, project.rolled_up_statuses.first
assert_equal IssueStatus.find(1), project.rolled_up_statuses.first