From 8e8f96761f61948c18a57a1e1461eb8d85273519 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 5 Sep 2012 09:56:45 -0300 Subject: [PATCH] Fix redirection to renamed articles in profiles with their own domain --- app/controllers/public/content_viewer_controller.rb | 2 +- test/functional/content_viewer_controller_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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