From e931f2b9cbf5c69a2b9c88755cd10f91eef42d0c Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 12 May 2008 15:55:46 +0000 Subject: [PATCH] ActionItem386: fixing creation of article with parent --- app/controllers/my_profile/cms_controller.rb | 2 ++ test/functional/cms_controller_test.rb | 7 +++++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 676d4d9..8adf0f2 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -10,6 +10,7 @@ class CmsController < MyProfileController include CmsHelper ARTICLE_TYPES = [ + Folder, TinyMceArticle, TextileArticle, RssFeed, @@ -70,6 +71,7 @@ class CmsController < MyProfileController raise ArgumentError.new("cannot create child of article which does not accept children") end @article.parent = parent + @parent_id = parent.id end @article.profile = profile diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index 0165794..942670f 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -308,4 +308,11 @@ class CmsControllerTest < Test::Unit::TestCase assert_sanitized assigns(:article).tag_list.names.join(', ') end + should 'keep informed parent_id' do + get :new, :profile => @profile.identifier, :parent_id => profile.home_page.id, :type => 'TextileArticle' + assert_tag :tag => 'input', :attributes => { :name => 'parent_id', :value => profile.home_page.id } + end + + + end -- libgit2 0.21.2