Permalink
Browse files

Removed white spaces

  • Loading branch information...
1 parent ede3e3b commit 07e62018ea8c046f5047784cb9ef8680b9747578 Ruslan Yakhyaev committed Sep 2, 2013
Showing with 10 additions and 11 deletions.
  1. +10 −11 test/has_ancestry_test.rb
@@ -1,7 +1,6 @@
require "environment"
class HasAncestryTreeTest < ActiveSupport::TestCase
-
def test_default_ancestry_column
AncestryTestDatabase.with_model do |model|
assert_equal :ancestry, model.ancestry_column
@@ -306,7 +305,7 @@ def test_orphan_restrict_strategy
end
end
end
-
+
def test_orphan_adopt_strategy
AncestryTestDatabase.with_model do |model|
model.orphan_strategy = :adopt # set the orphan strategy as paerntify
@@ -713,20 +712,20 @@ def test_arrange_order_option
end
end
end
-
+
def test_sort_by_ancestry
AncestryTestDatabase.with_model do |model|
n1 = model.create!
n2 = model.create!(:parent => n1)
n3 = model.create!(:parent => n2)
n4 = model.create!(:parent => n2)
n5 = model.create!(:parent => n1)
-
+
arranged = model.sort_by_ancestry(model.all.sort_by(&:id).reverse)
assert_equal [n1, n2, n4, n3, n5].map(&:id), arranged.map(&:id)
end
end
-
+
def test_node_excluded_by_default_scope_should_still_move_with_parent
AncestryTestDatabase.with_model(
:width => 3, :depth => 3, :extra_columns => {:deleted_at => :datetime},
@@ -737,7 +736,7 @@ def test_node_excluded_by_default_scope_should_still_move_with_parent
new_grandparent = roots[1]
parent = grandparent.children.first
child = parent.children.first
-
+
child.update_attributes :deleted_at => Time.now
parent.update_attributes :parent => new_grandparent
child.update_attributes :deleted_at => nil
@@ -754,11 +753,11 @@ def test_node_excluded_by_default_scope_should_be_destroyed_with_parent
) do |model, roots|
parent = model.roots.first
child = parent.children.first
-
+
child.update_attributes :deleted_at => Time.now
parent.destroy
child.update_attributes :deleted_at => nil
-
+
assert model.count.zero?
end
end
@@ -771,11 +770,11 @@ def test_node_excluded_by_default_scope_should_be_rootified
) do |model, roots|
parent = model.roots.first
child = parent.children.first
-
+
child.update_attributes :deleted_at => Time.now
parent.destroy
child.update_attributes :deleted_at => nil
-
+
assert child.reload.is_root?
end
end
@@ -805,7 +804,7 @@ def test_sort_by_ancestry_with_block
n4 = model.create!(:rank => 0, :parent => n2)
n5 = model.create!(:rank => 1, :parent => n1)
n6 = model.create!(:rank => 1, :parent => n2)
-
+
arranged = model.sort_by_ancestry(model.all.sort_by(&:rank).reverse) {|a, b| a.rank <=> b.rank}
assert_equal [n1, n3, n5, n2, n4, n6].map(&:id), arranged.map(&:id)
end

0 comments on commit 07e6201

Please sign in to comment.