diff options
author | Aditya Kapoor <aditya.kapoor@vinsol.com> | 2014-07-03 02:51:12 +0530 |
---|---|---|
committer | Aditya Kapoor <aditya.kapoor@vinsol.com> | 2014-07-03 02:51:12 +0530 |
commit | 7b1a42c05707c0e1f793bada3a448fd6f8630f5a (patch) | |
tree | b8f0a24f6e45f58f4fff147cf61100bfd531775c /activemodel/test | |
parent | c8f017682e507ba6cb4183c29cf9398a20211d15 (diff) | |
download | rails-7b1a42c05707c0e1f793bada3a448fd6f8630f5a.tar.gz rails-7b1a42c05707c0e1f793bada3a448fd6f8630f5a.tar.bz2 rails-7b1a42c05707c0e1f793bada3a448fd6f8630f5a.zip |
automatically include ActiveModel::Validations when include ActiveModel::SecurePassword
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/secure_password_test.rb | 5 | ||||
-rw-r--r-- | activemodel/test/models/user.rb | 1 | ||||
-rw-r--r-- | activemodel/test/models/visitor.rb | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb index e59f00c8c5..9e68cceb5f 100644 --- a/activemodel/test/cases/secure_password_test.rb +++ b/activemodel/test/cases/secure_password_test.rb @@ -20,6 +20,11 @@ class SecurePasswordTest < ActiveModel::TestCase ActiveModel::SecurePassword.min_cost = @original_min_cost end + test "user object should respond to valid?" do + assert_respond_to @visitor, :valid? + assert_respond_to @user, :valid? + end + test "create/update without validations" do assert @visitor.valid?(:create), 'visitor should be valid' assert @visitor.valid?(:update), 'visitor should be valid' diff --git a/activemodel/test/models/user.rb b/activemodel/test/models/user.rb index cbe259b1ad..1ec6001c48 100644 --- a/activemodel/test/models/user.rb +++ b/activemodel/test/models/user.rb @@ -1,6 +1,5 @@ class User extend ActiveModel::Callbacks - include ActiveModel::Validations include ActiveModel::SecurePassword define_model_callbacks :create diff --git a/activemodel/test/models/visitor.rb b/activemodel/test/models/visitor.rb index 4d7f4be097..22ad1a3c3d 100644 --- a/activemodel/test/models/visitor.rb +++ b/activemodel/test/models/visitor.rb @@ -1,6 +1,5 @@ class Visitor extend ActiveModel::Callbacks - include ActiveModel::Validations include ActiveModel::SecurePassword define_model_callbacks :create |