Skip to content
Browse files

specs and updates to confirm that the fields displayed in users/edit are

actually updatable.
  • Loading branch information...
1 parent b7ff043 commit d8ef50a628c9e8ca3901ba2a3ffe89087cf038c8 Chris Flipse committed Jul 13, 2008
Showing with 13 additions and 2 deletions.
  1. +3 −2 app/models/user/validation.rb
  2. +10 −0 spec/controllers/users_controller_spec.rb
View
5 app/models/user/validation.rb
@@ -17,7 +17,8 @@ class User
# prevents a user from submitting a crafted form that bypasses activation
# anything else you want your user to change should be added here.
- attr_accessible :login, :email, :password, :password_confirmation, :bio
+ attr_accessible :login, :email, :password, :password_confirmation, :bio,
+ :openid_url, :display_name, :website
# Encrypts some data with the salt.
def self.encrypt(password, salt)
@@ -53,4 +54,4 @@ def downcase_email_and_login
login.downcase!
email.downcase!
end
-end
+end
View
10 spec/controllers/users_controller_spec.rb
@@ -98,6 +98,16 @@ def create_user(options = {})
it_assigns :user, :flash => { :notice => :not_nil }
it_redirects_to { settings_path }
+
+ describe "updating from edit form" do
+ define_models :stubbed
+ %w(display_name openid_url website bio).each do |field|
+ it "should update #{field}" do
+ put :update, :id => 1, :user => { field, "test" }
+ assigns(:user).attributes[field].should == "test"
+ end
+ end
+ end
end
describe UsersController, "(successful save, xml)" do

0 comments on commit d8ef50a

Please sign in to comment.
Something went wrong with that request. Please try again.