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 @@ -2850,6 +2850,29 @@ def test_saving_twice_should_not_duplicate_journal_details
2850
2850
end
2851
2851
end
2852
2852
2853
+ test "done ratio of existing issues follows the new issue_done_ratio setting" do
2854
+ closed_status = IssueStatus . find ( 5 )
2855
+ closed_status . update! ( :default_done_ratio => 90 )
2856
+
2857
+ issue = Issue . generate! ( :status_id => 1 , :done_ratio => 30 )
2858
+ issue . update! ( :status => closed_status )
2859
+
2860
+ with_settings :issue_done_ratio => 'issue_status' do
2861
+ assert_equal 90 , issue . done_ratio
2862
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2863
+ end
2864
+
2865
+ with_settings :issue_done_ratio => 'issue_field_and_closed_status' do
2866
+ assert_equal 100 , issue . done_ratio
2867
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2868
+ end
2869
+
2870
+ with_settings :issue_done_ratio => 'issue_field' do
2871
+ assert_equal 30 , issue . done_ratio
2872
+ assert_equal 30 , issue . read_attribute ( :done_ratio )
2873
+ end
2874
+ end
2875
+
2853
2876
test "#by_tracker" do
2854
2877
User . current = User . find ( 2 )
2855
2878
groups = Issue . by_tracker ( Project . find ( 1 ) )
You can’t perform that action at this time.
0 commit comments