Sha256: fa73c859eaad0271cd8c1e022f967c2c462aa9ad4cedefb3a49732c7d4df12df

Contents?: true

Size: 899 Bytes

Versions: 2

Compression:

Stored size: 899 Bytes

Contents

module ConditionalTests
  def test_conditional_item_creation_should_not_be_in_list_if_conditions_not_met
    item = create_with_conditions_not_met
    assert !item.in_list?
    assert_nil item.position
  end
  
  def test_conditional_item_should_be_removed_from_list_after_update_if_conditions_not_met
    assert @items.first.in_list?
    fail_conditions @items.first
    assert !@items.first.in_list?
    assert_nil @items.first.position
  end
  
  def test_conditional_item_removal_due_to_conditions_should_shift_lower_items
    assert_equal [1,2,3,4], positions
    fail_conditions @items.first
    assert_equal_ids [2,3,4]
    assert_equal [nil,1,2,3], positions
  end
  
  def test_conditional_item_should_be_added_to_list_if_after_update_it_meets_conditions
    fail_conditions @items.first
    assert_equal_ids [2,3,4]
    pass_conditions @items.first
    assert_equal_ids [2,3,4,1]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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