Created
November 9, 2010 01:43
-
-
Save developish/668594 to your computer and use it in GitHub Desktop.
How to use authogic without requiring a password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
acts_as_authentic do |config| | |
config.validate_password_field :if => :require_password_on_signup? | |
end | |
def require_password_on_signup? | |
false | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class UserTest < ActiveSupport::TestCase | |
test "password requirement" do | |
@user = User.new | |
@user.valid? | |
assert_equal [], @user.errors[:password] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment