Sha256: 58cb326c9d1858c3dbf55c08a9f175a8ff8ab4f1dea5862bb9882bd869b6dc6d

Contents?: true

Size: 710 Bytes

Versions: 2

Compression:

Stored size: 710 Bytes

Contents

require 'test_helper'

class ScopedItemWithGapsTest < ActiveSupport::TestCase
  
  # Lists: 1 (gap) 2 (gap) (gap) 3 (gap) 4
  def setup
    16.times { |index| ScopedItem.create :parent_id => index % 2}
    [3,4,7,8,9,10,13,14].each { |index| ScopedItem.delete(index) }
    @items = ScopedItem.find(:all, :order => 'id', :conditions => {:parent_id => 1})
    @ids = @items.map(&:id)
  end

  include SimpleTests
  include ScopedTests
  include SimpleGapTests
  
  protected
    def ordered_ids
      ScopedItem.find(:all, :order => 'position', :conditions => 'parent_id = 1 AND position IS NOT NULL').map(&:id)
    end
    
    def create(parent_id)
      ScopedItem.create(:parent_id => parent_id)
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aguids-positionable-0.2.1 test/rails_root/test/unit/scoped_item_with_gaps_test.rb
aguids-positionable-0.2.2 test/rails_root/test/unit/scoped_item_with_gaps_test.rb