@@ -99,6 +99,20 class IssuePriorityTest < ActiveSupport::TestCase | |||
|
99 | 99 | assert_equal %w(lowest default high4 high3 high2 highest), IssuePriority.active.to_a.sort.map(&:position_name) |
|
100 | 100 | end |
|
101 | 101 | |
|
102 | def test_moving_a_priority_should_update_position_names | |
|
103 | prio = IssuePriority.first | |
|
104 | prio.move_to = 'lowest' | |
|
105 | prio.reload | |
|
106 | assert_equal 'highest', prio.position_name | |
|
107 | end | |
|
108 | ||
|
109 | def test_deactivating_a_priority_should_update_position_names | |
|
110 | prio = IssuePriority.active.order(:position).last | |
|
111 | prio.active = false | |
|
112 | prio.save | |
|
113 | assert_equal 'highest', IssuePriority.active.order(:position).last.position_name | |
|
114 | end | |
|
115 | ||
|
102 | 116 | def test_destroying_a_priority_should_update_position_names |
|
103 | 117 | IssuePriority.find_by_position_name('highest').destroy |
|
104 | 118 | assert_equal %w(lowest default high2 highest), IssuePriority.active.to_a.sort.map(&:position_name) |
General Comments 0
You need to be logged in to leave comments.
Login now