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


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

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

#teardownObject


208
209
210
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 208

def teardown
  teardown_db
end

#test_rootObject


212
213
214
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 212

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

#test_rootsObject


216
217
218
# File 'lib/plugins/acts_as_tree/test/acts_as_tree_test.rb', line 216

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