Commit 84bc45839645ab539c231ef39afff5d20fafe546
1 parent
6d682759
Exists in
master
and in
29 other branches
ActionItem70: implementing explode_path
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@545 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
11 additions
and
0 deletions
Show diff stats
app/models/category.rb
test/unit/category_test.rb
... | ... | @@ -195,4 +195,11 @@ class CategoryTest < Test::Unit::TestCase |
195 | 195 | assert_equal c1, c3.top_ancestor |
196 | 196 | end |
197 | 197 | |
198 | + should 'explode path' do | |
199 | + c1 = Category.create!(:name => 'parent', :environment_id => @env.id) | |
200 | + c2 = Category.create!(:name => 'child', :environment_id => @env.id, :parent_id => c1.id) | |
201 | + | |
202 | + assert_equal [ 'parent', 'child'], c2.explode_path | |
203 | + end | |
204 | + | |
198 | 205 | end | ... | ... |