Sha256: af49712381036a94047229732285988fa2d7dae122becc3ff50d9dfba0e63864
Contents?: true
Size: 905 Bytes
Versions: 2
Compression:
Stored size: 905 Bytes
Contents
require 'test_helper' class ConditionalItemTest < ActiveSupport::TestCase def setup 8.times { |index| (index % 2) > 0 ? ConditionalItem.create(:tag => 'todo') : ConditionalItem.create(:tag => 'bad')} @items = ConditionalItem.find(:all, :conditions => "position IS NOT NULL", :order => 'id') @ids = @items.map(&:id) end include SimpleTests include SimpleGaplessTests include ConditionalTests protected def ordered_ids ConditionalItem.find(:all, :order => 'position', :conditions => "position IS NOT NULL").map(&:id) end def create(tag, *args) ConditionalItem.create(:tag => tag || 'todo') end def create_with_conditions_not_met create('bad_tag') end def fail_conditions(item) item.tag = 'bad_tag' item.save end def pass_conditions(item) item.tag = 'todo' item.save end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aguids-positionable-0.2.1 | test/rails_root/test/unit/conditional_item_test.rb |
aguids-positionable-0.2.2 | test/rails_root/test/unit/conditional_item_test.rb |