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 @@ -2900,6 +2900,29 @@ def test_saving_twice_should_not_duplicate_journal_details
2900
2900
end
2901
2901
end
2902
2902
2903
+ test "done ratio of existing issues follows the new issue_done_ratio setting" do
2904
+ closed_status = IssueStatus . find ( 5 )
2905
+ closed_status . update! ( :default_done_ratio => 90 )
2906
+
2907
+ issue = Issue . generate! ( :status_id => 1 , :done_ratio => 30 )
2908
+ issue . update! ( :status => closed_status )
2909
+
2910
+ with_settings :issue_done_ratio => 'issue_status' do
2911
+ assert_equal 90 , issue . done_ratio
2912
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2913
+ end
2914
+
2915
+ with_settings :issue_done_ratio => 'issue_field_and_closed_status' do
2916
+ assert_equal 100 , issue . done_ratio
2917
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2918
+ end
2919
+
2920
+ with_settings :issue_done_ratio => 'issue_field' do
2921
+ assert_equal 30 , issue . done_ratio
2922
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2923
+ end
2924
+ end
2925
+
2903
2926
test "#by_tracker" do
2904
2927
User . current = User . find ( 2 )
2905
2928
groups = Issue . by_tracker ( Project . find ( 1 ) )
You can’t perform that action at this time.
0 commit comments