Sha256: 1a08df06089ecd7470a2c1788b5c5f9dcebaccc1913618f12a83075ab1b4e270
Contents?: true
Size: 1.4 KB
Versions: 2
Compression:
Stored size: 1.4 KB
Contents
module ScopedTests def test_scoped_insert item = create(170) assert item.in_list? assert item.first? assert item.last? assert_equal 1, item.list_position end # Unescoped Tests def test_unescoped_insert item = create(nil) assert item.in_list? assert item.first? assert item.last? assert_equal 1, item.list_position item_2 = create(nil) assert item_2.in_list? assert !item_2.first? assert item_2.last? assert_equal 2, item_2.list_position end # Scope Changed Tests def test_scoped_should_remove_from_previous_list_after_scope_change @items.second.parent_id = 170; @items.second.save assert @items.second.in_list? assert @items.second.first? assert_equal_ids [1,3,4] end def test_scoped_should_add_to_new_list_bottoms_position @items.second.parent_id = 170; @items.second.save @items.second.parent_id = @items.first.parent_id; @items.second.save assert @items.second.last? assert_equal_ids [1,3,4,2] end def test_scoped_changed_to_nil_scope @items.second.parent_id = nil; @items.second.save assert @items.second.in_list? assert @items.second.first? end def test_scoped_changed_from_nil @items.second.parent_id = nil; @items.second.save @items.second.parent_id = @items.first.parent_id; @items.second.save assert @items.second.last? assert_equal_ids [1,3,4,2] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aguids-positionable-0.2.1 | test/rails_root/test/scoped_tests.rb |
aguids-positionable-0.2.2 | test/rails_root/test/scoped_tests.rb |