diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/mixin_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/mixin_test.rb b/activerecord/test/mixin_test.rb index 96e6f7442f..df03bcd9a7 100644 --- a/activerecord/test/mixin_test.rb +++ b/activerecord/test/mixin_test.rb @@ -65,6 +65,22 @@ class ListTest < Test::Unit::TestCase ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos') end + + def test_move_to_bottom_with_next_to_last_item + assert_equal [mixins(:list_1), + mixins(:list_2), + mixins(:list_3), + mixins(:list_4)], + ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos') + + mixins(:list_3).move_to_bottom + + assert_equal [mixins(:list_1), + mixins(:list_2), + mixins(:list_4), + mixins(:list_3)], + ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos') + end def test_next_prev assert_equal mixins(:list_2), mixins(:list_1).lower_item |