X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fdb_helper%2Facts_as_list.t;h=2e7b7086473ec4e53af30b7b607d79ed2d9ac344;hb=3dc3b056259f35b6fcf6656da6a652c024fee3b5;hp=0d47bb2537492a413e1ae0ef528c3e1b66c251f3;hpb=001c83b188e6a6394761c217d28984553f351c00;p=kivitendo-erp.git diff --git a/t/db_helper/acts_as_list.t b/t/db_helper/acts_as_list.t index 0d47bb253..2e7b70864 100644 --- a/t/db_helper/acts_as_list.t +++ b/t/db_helper/acts_as_list.t @@ -1,4 +1,4 @@ -use Test::More tests => 50; +use Test::More tests => 51; use Test::Exception; use strict; @@ -206,6 +206,10 @@ reset_state(); $item = get_item(8); $item->remove_from_list; $item->parent_id(3); $item->add_to_list(position => 'first'); test_positions "add_to_list position 'first' in empty", [ 1, undef, 1 ], [ 2, undef, 2 ], [ 3, 1, 1 ], [ 4, 1, 2 ], [ 5, 1, 3 ], [ 6, 4, 1 ], [ 7, 4, 2 ], [ 8, 3, 1 ]; +reset_state(); +$item = get_item(5); $item->add_to_list(position => 'after', reference => 3); +test_positions "add_to_list without prior remove_from_list", [ 1, undef, 1 ], [ 2, undef, 2 ], [ 3, 1, 1 ], [ 5, 1, 2 ], [ 4, 1, 3 ], [ 6, 4, 1 ], [ 7, 4, 2 ], [ 8, 2, 1 ]; + reset_state(); $item = get_item(4); is($item->get_next_in_list->id, 5, 'Next of 4 is 5');