diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-12-20 14:07:12 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-12-20 14:07:12 +0000 |
commit | ff7938cff203b7ebc3a85e716b218e33833423fc (patch) | |
tree | 5985e01ffb7c43655ccc73398103b2df1b8826f0 /test/unit/issue_priority_test.rb | |
parent | 18b4925cee168185c24e2aa33e56786fdf7c676c (diff) | |
download | redmine-ff7938cff203b7ebc3a85e716b218e33833423fc.tar.gz redmine-ff7938cff203b7ebc3a85e716b218e33833423fc.zip |
IssuePriority.position_name not recalculated every time it should (#21504).
Patch by Felix Schäfer.
git-svn-id: http://svn.redmine.org/redmine/trunk@14989 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_priority_test.rb')
-rw-r--r-- | test/unit/issue_priority_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/issue_priority_test.rb b/test/unit/issue_priority_test.rb index e9d44b68e..afce3688a 100644 --- a/test/unit/issue_priority_test.rb +++ b/test/unit/issue_priority_test.rb @@ -99,6 +99,20 @@ class IssuePriorityTest < ActiveSupport::TestCase assert_equal %w(lowest default high4 high3 high2 highest), IssuePriority.active.to_a.sort.map(&:position_name) end + def test_moving_a_priority_should_update_position_names + prio = IssuePriority.first + prio.move_to = 'lowest' + prio.reload + assert_equal 'highest', prio.position_name + end + + def test_deactivating_a_priority_should_update_position_names + prio = IssuePriority.active.order(:position).last + prio.active = false + prio.save + assert_equal 'highest', IssuePriority.active.order(:position).last.position_name + end + def test_destroying_a_priority_should_update_position_names IssuePriority.find_by_position_name('highest').destroy assert_equal %w(lowest default high2 highest), IssuePriority.active.to_a.sort.map(&:position_name) |