diff options
| author | mo k <mo@mokhan.ca> | 2012-05-25 19:35:51 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-05-25 19:35:51 -0600 |
| commit | cf4f7ff7f6fbfcdcd4abad8b1493103fe6206f4f (patch) | |
| tree | 0a3f0e66e7273a2c1596ec9819f6e6cfa1ccbb6d | |
| parent | 26d503eab23349ee9fb90ef956dc5dd681dc7ef8 (diff) | |
start building specs for registration controller.
| -rw-r--r-- | app/controllers/registrations_controller.rb | 2 | ||||
| -rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 97bf7375..02b68144 100644 --- a/app/controllers/registrations_controller.rb +++ b/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]) diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index a1b80206..be9f05fc 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/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 |
