Commit 8c112a4a7bbb72f5f060acc29b86a323849a2a48
Committed by
Antonio Terceiro
1 parent
22538ba2
Exists in
master
and in
29 other branches
ActionItem1239: crash while viewing community
Showing
2 changed files
with
3 additions
and
4 deletions
Show diff stats
app/controllers/public/content_viewer_controller.rb
@@ -13,8 +13,7 @@ class ContentViewerController < ApplicationController | @@ -13,8 +13,7 @@ class ContentViewerController < ApplicationController | ||
13 | if path.blank? | 13 | if path.blank? |
14 | @page = profile.home_page | 14 | @page = profile.home_page |
15 | if @page.nil? | 15 | if @page.nil? |
16 | - @tags = profile.tags | ||
17 | - render :template => 'profile/index' | 16 | + redirect_to :controller => 'profile', :action => 'index', :profile => profile.identifier |
18 | return | 17 | return |
19 | end | 18 | end |
20 | else | 19 | else |
test/functional/content_viewer_controller_test.rb
@@ -816,10 +816,10 @@ class ContentViewerControllerTest < Test::Unit::TestCase | @@ -816,10 +816,10 @@ class ContentViewerControllerTest < Test::Unit::TestCase | ||
816 | assert_no_tag :tag => 'div', :attributes => { :id => 'article-source' } | 816 | assert_no_tag :tag => 'div', :attributes => { :id => 'article-source' } |
817 | end | 817 | end |
818 | 818 | ||
819 | - should 'render profile screen when there is no homepage' do | 819 | + should 'redirect to profile controller when there is no homepage' do |
820 | profile.home_page.destroy | 820 | profile.home_page.destroy |
821 | get :view_page, :profile => profile.identifier, :page => [] | 821 | get :view_page, :profile => profile.identifier, :page => [] |
822 | - assert_template 'profile/index' | 822 | + assert_redirected_to :controller => 'profile', :action => 'index', :profile => profile.identifier |
823 | end | 823 | end |
824 | 824 | ||
825 | should "not display 'Upload files' when viewing blog" do | 825 | should "not display 'Upload files' when viewing blog" do |