From 4b20afd51e640d67a32b241349be9d2f7eac64b0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 3 Apr 2011 11:22:39 +0100 Subject: [PATCH] Preserve the referer at the end of account creation --- app/controllers/user_controller.rb | 4 ++-- test/functional/user_controller_test.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 25dd18f92..649c0c907 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -95,9 +95,9 @@ class UserController < ApplicationController flash[:notice] = t 'user.new.flash create success message', :email => @user.email Notifier.deliver_signup_confirm(@user, @user.tokens.create(:referer => params[:referer])) session[:token] = @user.tokens.create.token - redirect_to :action => 'login' + redirect_to :action => 'login', :referer => params[:referer] else - render :action => 'new' + render :action => 'new', :referer => params[:referer] end end end diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb index cbe66a0db..1c591f0e6 100644 --- a/test/functional/user_controller_test.rb +++ b/test/functional/user_controller_test.rb @@ -43,7 +43,7 @@ class UserControllerTest < ActionController::TestCase assert_match /#{@url}/, register_email.body # Check the page - assert_redirected_to :action => 'login' + assert_redirected_to :action => 'login', :referer => nil ActionMailer::Base.deliveries.clear end -- 2.43.2