Permalink
Browse files

fixed sorted hierarchy test model and spec 'be_sorted' matcher

  • Loading branch information...
khustochka committed Jan 22, 2010
1 parent 2a6d376 commit 0406243204cddc3afca225a56b75c46819b19a8c
Showing with 2 additions and 2 deletions.
  1. +1 −1 test/test_helper.rb
  2. +1 −1 test/unit/sorted_hierarchy/model.rb
View
@@ -53,7 +53,7 @@ def be_sorted
if klass.top_level?
klass.all(:select => sort_column, :order => sort_column).map {|item| item[sort_column] }.should == Array(1..klass.count)
else
- klass.parent_class.all(:order => sort_column, :include => :children).each do |parent|
+ klass.parent_class.all(:order => klass.parent_class.get_sort_column, :include => :children).each do |parent|
parent.children.map {|item| item[sort_column] }.should == Array(1..parent.children.size)
end
end
@@ -15,5 +15,5 @@ class District < AdministrativeUnit
class Street < ActiveRecord::Base
include SortedHierarchy::ActiveRecord
- child_of :city
+ child_of :district
end

0 comments on commit 0406243

Please sign in to comment.