File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2916,6 +2916,29 @@ def test_saving_twice_should_not_duplicate_journal_details
2916
2916
end
2917
2917
end
2918
2918
2919
+ test "done ratio of existing issues follows the new issue_done_ratio setting" do
2920
+ closed_status = IssueStatus . find ( 5 )
2921
+ closed_status . update! ( :default_done_ratio => 90 )
2922
+
2923
+ issue = Issue . generate! ( :status_id => 1 , :done_ratio => 30 )
2924
+ issue . update! ( :status => closed_status )
2925
+
2926
+ with_settings :issue_done_ratio => 'issue_status' do
2927
+ assert_equal 90 , issue . done_ratio
2928
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2929
+ end
2930
+
2931
+ with_settings :issue_done_ratio => 'issue_field_and_closed_status' do
2932
+ assert_equal 100 , issue . done_ratio
2933
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2934
+ end
2935
+
2936
+ with_settings :issue_done_ratio => 'issue_field' do
2937
+ assert_equal 30 , issue . done_ratio
2938
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2939
+ end
2940
+ end
2941
+
2919
2942
test "#by_tracker" do
2920
2943
User . current = User . find ( 2 )
2921
2944
groups = Issue . by_tracker ( Project . find ( 1 ) )
You can’t perform that action at this time.
0 commit comments