From: martyntaylor <[email protected]>

---
 src/app/controllers/users_controller.rb       |    9 +++++++--
 src/spec/controllers/users_controller_spec.rb |    2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/app/controllers/users_controller.rb 
b/src/app/controllers/users_controller.rb
index 8ab16e3..9bd037c 100644
--- a/src/app/controllers/users_controller.rb
+++ b/src/app/controllers/users_controller.rb
@@ -33,8 +33,13 @@ class UsersController < ApplicationController
 
     @registration = RegistrationService.new(@user)
     if @registration.save
-      flash[:notice] = "User registered!"
-      redirect_to users_path
+      if @current_user
+        flash[:notice] = "User registered!"
+        redirect_to users_path
+      else
+        flash[:notice] = "You have successfully registered!"
+        redirect_to :dashboard
+      end
     else
       flash[:warning] = "user registration failed: #[email protected]}"
       render :action => :new
diff --git a/src/spec/controllers/users_controller_spec.rb 
b/src/spec/controllers/users_controller_spec.rb
index ad1f1cd..92435f4 100644
--- a/src/spec/controllers/users_controller_spec.rb
+++ b/src/spec/controllers/users_controller_spec.rb
@@ -47,7 +47,7 @@ describe UsersController do
                                    :password_confirmation => "testpass" }
         }.should change{ User.count }
         user = User.find(:first, :conditions => ['login = ?', "tuser2"])
-        response.should redirect_to(users_url)
+        response.should redirect_to(dashboard_url)
       end
 
       it "fails to create pool" do
-- 
1.7.2.3

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to