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 @@ -2938,6 +2938,29 @@ def test_saving_twice_should_not_duplicate_journal_details
2938
2938
end
2939
2939
end
2940
2940
2941
+ test "done ratio of existing issues follows the new issue_done_ratio setting" do
2942
+ closed_status = IssueStatus . find ( 5 )
2943
+ closed_status . update! ( :default_done_ratio => 90 )
2944
+
2945
+ issue = Issue . generate! ( :status_id => 1 , :done_ratio => 30 )
2946
+ issue . update! ( :status => closed_status )
2947
+
2948
+ with_settings :issue_done_ratio => 'issue_status' do
2949
+ assert_equal 90 , issue . done_ratio
2950
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2951
+ end
2952
+
2953
+ with_settings :issue_done_ratio => 'issue_field_and_closed_status' do
2954
+ assert_equal 100 , issue . done_ratio
2955
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2956
+ end
2957
+
2958
+ with_settings :issue_done_ratio => 'issue_field' do
2959
+ assert_equal 30 , issue . done_ratio
2960
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2961
+ end
2962
+ end
2963
+
2941
2964
test "#by_tracker" do
2942
2965
User . current = User . find ( 2 )
2943
2966
groups = Issue . by_tracker ( Project . find ( 1 ) )
You can’t perform that action at this time.
0 commit comments