diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index 4679dae..2ebbeac 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -19,7 +19,7 @@ class ContentViewerController < ApplicationController unless @page page_from_old_path = profile.articles.find_by_old_path(path) if page_from_old_path - redirect_to :profile => profile.identifier, :page => page_from_old_path.explode_path + redirect_to profile.url.merge(:page => page_from_old_path.explode_path) return end end diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index c741ea0..2f68b6f 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -474,7 +474,7 @@ class ContentViewerControllerTest < ActionController::TestCase get :view_page, :profile => p.identifier, :page => old_path assert_response :redirect - assert_redirected_to :profile => p.identifier, :page => a.explode_path + assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a.explode_path end should 'load new article name equal of another article old name' do @@ -503,7 +503,7 @@ class ContentViewerControllerTest < ActionController::TestCase get :view_page, :profile => p.identifier, :page => old_path assert_response :redirect - assert_redirected_to :profile => p.identifier, :page => a2.explode_path + assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a2.explode_path end should 'not return an article of a different user' do -- libgit2 0.21.2