Class: TreeTestWithoutOrder

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/plugins/acts_as_tree/test/acts_as_tree_test.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



204
205
206
207
208
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 204

def setup                               
  setup_db
  @root1 = TreeMixinWithoutOrder.create!
  @root2 = TreeMixinWithoutOrder.create!
end

#teardownObject



210
211
212
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 210

def teardown
  teardown_db
end

#test_rootObject



214
215
216
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 214

def test_root
  assert [@root1, @root2].include?(TreeMixinWithoutOrder.root)
end

#test_rootsObject



218
219
220
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 218

def test_roots
  assert_equal [], [@root1, @root2] - TreeMixinWithoutOrder.roots
end