Commit cf4f7ff7

mo k <mo@mokhan.ca>
2012-05-26 01:35:51
start building specs for registration controller.
1 parent 26d503e
Changed files (2)
app/controllers/registrations_controller.rb
@@ -4,6 +4,8 @@ class RegistrationsController < Devise::RegistrationsController
   end
 
   def update
+    params "PARAMS: #{params[:user]}"
+    logger.info("PARAMS: #{params[:user]}")
     @user = current_user
     if params[:user][:password].blank? 
       if @user.update_without_password(params[:user])
spec/controllers/registrations_controller_spec.rb
@@ -1,5 +1,9 @@
-#require_relative '../../app/controllers/registrations_controller'
 require 'spec_helper'
+#module Devise
+  #class RegistrationsController
+
+  #end
+#end
 
 describe RegistrationsController do
   before (:each) do
@@ -7,24 +11,24 @@ describe RegistrationsController do
   end
   let(:user){ FactoryGirl.build(:user) }
 
-  context "when updating a users website" do
+  context "when updating a users profile settings not including their password" do
     it "should update their website" do
       controller = RegistrationsController.new
-      #controller.update
 
       blah = {
         :current_password =>'',
         :email => '',
         :facebook => '',
-        :name =>'',
+        #:name =>'',
         :password => '',
         :password_confirmation => '',
         :twitter => '',
         :website => '',
       }
 
-      user.should_receive[:update_without_password].with(blah)
-      put :update, :user => blah
+      #user.should_receive[:update_without_password].with(blah)
+      #controller.update
+      put :update, :user => {:hello => "mo"}
     end
     it "should not change their password" do