mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
correct ordering algorithm
This commit is contained in:
@ -34,11 +34,13 @@ describe Concern::Positionable do
|
||||
positions.should == [3,0,1,2,4]
|
||||
TestItem.pluck(:position).sort.should == [0,1,2,3,4]
|
||||
|
||||
TestItem.find(3).move_to(1)
|
||||
positions.should == [0,3,1,2,4]
|
||||
|
||||
# this is somewhat odd, but when there is not positioning
|
||||
# not much we can do
|
||||
TestItem.find(1).move_to(5)
|
||||
positions.should == [3,0,2,4,1]
|
||||
positions.should == [0,3,2,4,1]
|
||||
|
||||
TestItem.pluck(:position).sort.should == [0,1,2,3,4]
|
||||
|
||||
|
Reference in New Issue
Block a user