From 8c112a4a7bbb72f5f060acc29b86a323849a2a48 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Tue, 8 Sep 2009 18:44:40 -0300 Subject: [PATCH] ActionItem1239: crash while viewing community --- app/controllers/public/content_viewer_controller.rb | 3 +-- test/functional/content_viewer_controller_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index 123703e..df25ff2 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -13,8 +13,7 @@ class ContentViewerController < ApplicationController if path.blank? @page = profile.home_page if @page.nil? - @tags = profile.tags - render :template => 'profile/index' + redirect_to :controller => 'profile', :action => 'index', :profile => profile.identifier return end else diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 7125a64..52e7e79 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -816,10 +816,10 @@ class ContentViewerControllerTest < Test::Unit::TestCase assert_no_tag :tag => 'div', :attributes => { :id => 'article-source' } end - should 'render profile screen when there is no homepage' do + should 'redirect to profile controller when there is no homepage' do profile.home_page.destroy get :view_page, :profile => profile.identifier, :page => [] - assert_template 'profile/index' + assert_redirected_to :controller => 'profile', :action => 'index', :profile => profile.identifier end should "not display 'Upload files' when viewing blog" do -- libgit2 0.21.2