]> git.openstreetmap.org Git - rails.git/commitdiff
Preserve the referer at the end of account creation
authorTom Hughes <tom@compton.nu>
Sun, 3 Apr 2011 10:22:39 +0000 (11:22 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 3 Apr 2011 12:46:18 +0000 (13:46 +0100)
app/controllers/user_controller.rb
test/functional/user_controller_test.rb

index 25dd18f9223b905493baf91b50b1f5ecfd5568e3..649c0c9078792afc184c4961cbda6a0ef8c77094 100644 (file)
@@ -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
index cbe66a0dbee43a1230abd579cdbe97e923419896..1c591f0e63ef733624b15488e9ecdf35abf54ada 100644 (file)
@@ -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