Commit 0f3973a7c641a987410e31039e3e211a82cac926

Authored by Joenio Costa
Committed by Daniela Feitosa
1 parent a815c2ef

Avoiding problems when request 'join_not_logged' via GET

(ActionItem1884)
app/controllers/public/profile_controller.rb
... ... @@ -105,6 +105,8 @@ class ProfileController < PublicController
105 105 end
106 106 if request.xhr?
107 107 render :layout => false
  108 + else
  109 + redirect_to profile.url
108 110 end
109 111 end
110 112 end
... ...
test/functional/profile_controller_test.rb
... ... @@ -1159,4 +1159,13 @@ class ProfileControllerTest < Test::Unit::TestCase
1159 1159 assert_tag :tag => 'div', :content => /#{plugin1_tab[:content]}/, :attributes => {:id => /#{plugin1_tab[:id]}/}
1160 1160 end
1161 1161  
  1162 + should 'redirect to profile page when try to request join_not_logged via GET method' do
  1163 + community = Community.create!(:name => 'my test community')
  1164 + login_as(profile.identifier)
  1165 + get :join_not_logged, :profile => community.identifier
  1166 + assert_nothing_raised do
  1167 + assert_redirected_to community.url
  1168 + end
  1169 + end
  1170 +
1162 1171 end
... ...