Sha256: 5bc2373097a1e985db57c5ebfe6d65924ddf75719c0227d33e69c6a95d24ccf5

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

require 'test_helper'

class ScopedItemTest < ActiveSupport::TestCase
  def setup
    8.times { |index| ScopedItem.create :parent_id => index % 2}
    @items = ScopedItem.find(:all, :order => 'id', :conditions => {:parent_id => 1})
    @ids = @items.map(&:id)
  end

  include SimpleTests
  include SimpleGaplessTests
  include ScopedTests
  
  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_test.rb
aguids-positionable-0.2.2 test/rails_root/test/unit/scoped_item_test.rb