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