Commit e931f2b9cbf5c69a2b9c88755cd10f91eef42d0c
1 parent
c4c96433
Exists in
master
and in
29 other branches
ActionItem386: fixing creation of article with parent
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1786 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
9 additions
and
0 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
... | ... | @@ -10,6 +10,7 @@ class CmsController < MyProfileController |
10 | 10 | include CmsHelper |
11 | 11 | |
12 | 12 | ARTICLE_TYPES = [ |
13 | + Folder, | |
13 | 14 | TinyMceArticle, |
14 | 15 | TextileArticle, |
15 | 16 | RssFeed, |
... | ... | @@ -70,6 +71,7 @@ class CmsController < MyProfileController |
70 | 71 | raise ArgumentError.new("cannot create child of article which does not accept children") |
71 | 72 | end |
72 | 73 | @article.parent = parent |
74 | + @parent_id = parent.id | |
73 | 75 | end |
74 | 76 | |
75 | 77 | @article.profile = profile | ... | ... |
test/functional/cms_controller_test.rb
... | ... | @@ -308,4 +308,11 @@ class CmsControllerTest < Test::Unit::TestCase |
308 | 308 | assert_sanitized assigns(:article).tag_list.names.join(', ') |
309 | 309 | end |
310 | 310 | |
311 | + should 'keep informed parent_id' do | |
312 | + get :new, :profile => @profile.identifier, :parent_id => profile.home_page.id, :type => 'TextileArticle' | |
313 | + assert_tag :tag => 'input', :attributes => { :name => 'parent_id', :value => profile.home_page.id } | |
314 | + end | |
315 | + | |
316 | + | |
317 | + | |
311 | 318 | end | ... | ... |