From 55b7d4dbf224bb4fd70d1ca942447a6abb343d1a Mon Sep 17 00:00:00 2001 From: did Date: Tue, 5 Jun 2012 09:32:10 -0700 Subject: [PATCH] status of a redirect page is now 301 (previously 302) --- Gemfile.lock | 2 +- lib/locomotive/render.rb | 2 +- spec/dummy/config/application.rb | 2 +- spec/lib/locomotive/render_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 846fac59..56cfe354 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - locomotive_cms (2.0.0.rc7) + locomotive_cms (2.0.0.rc8) RedCloth (~> 4.2.8) actionmailer-with-request (~> 0.3.0) bson_ext (~> 1.5.2) diff --git a/lib/locomotive/render.rb b/lib/locomotive/render.rb index cc478e05..48fd39dc 100644 --- a/lib/locomotive/render.rb +++ b/lib/locomotive/render.rb @@ -11,7 +11,7 @@ module Locomotive else @page = locomotive_page - redirect_to(@page.redirect_url) and return if @page.present? && @page.redirect? + redirect_to(@page.redirect_url, :status => 301) and return if @page.present? && @page.redirect? render_no_page_error and return if @page.nil? diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index ff0351b5..ae07f1f8 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__) require 'action_controller/railtie' require 'action_mailer/railtie' require 'active_resource/railtie' -require 'sprockets/railtie' +# require 'sprockets/railtie' # Bundler.require Bundler.require(*Rails.groups(:assets => %w(development test))) diff --git a/spec/lib/locomotive/render_spec.rb b/spec/lib/locomotive/render_spec.rb index 3ae0e2f7..c9b5b626 100644 --- a/spec/lib/locomotive/render_spec.rb +++ b/spec/lib/locomotive/render_spec.rb @@ -130,7 +130,7 @@ describe 'Locomotive rendering system' do end it 'redirects to the redirect_url' do - @controller.expects(:redirect_to).with('http://www.example.com/').returns(true) + @controller.expects(:redirect_to).with('http://www.example.com/', { :status => 301 }).returns(true) @controller.send(:render_locomotive_page) end