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