Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move HaveSecurePasswordMatcher to ActiveModel directory and rename re…

…ferences accordingly
  • Loading branch information...
commit 3fcc3cf75cceab0917220f2e5d43af92ba0fb59c 1 parent 4610354
@jwulff authored
View
1  lib/shoulda/matchers/active_model.rb
@@ -4,6 +4,7 @@
require 'shoulda/matchers/active_model/ensure_length_of_matcher'
require 'shoulda/matchers/active_model/ensure_inclusion_of_matcher'
require 'shoulda/matchers/active_model/ensure_exclusion_of_matcher'
+require 'shoulda/matchers/active_model/have_secure_password_matcher'
require 'shoulda/matchers/active_model/validate_presence_of_matcher'
require 'shoulda/matchers/active_model/validate_format_of_matcher'
require 'shoulda/matchers/active_model/validate_uniqueness_of_matcher'
View
7 ...ers/active_record/have_secure_password_matcher.rb → ...hers/active_model/have_secure_password_matcher.rb
@@ -1,10 +1,10 @@
module Shoulda # :nodoc:
module Matchers
- module ActiveRecord # :nodoc:
+ module ActiveModel # :nodoc:
# Ensures that the model uses has_secure_password
#
- # it { should have_secure_password(:password) }
+ # it { should have_secure_password }
#
def have_secure_password
HaveSecurePasswordMatcher.new
@@ -12,8 +12,7 @@ def have_secure_password
class HaveSecurePasswordMatcher # :nodoc:
def matches?(subject)
- @subject = subject
- @subject.class.included_modules.collect(&:to_s).include?('ActiveModel::SecurePassword::InstanceMethodsOnActivation')
+ subject.class.included_modules.collect(&:to_s).include?('ActiveModel::SecurePassword::InstanceMethodsOnActivation')
end
def failure_message
View
1  lib/shoulda/matchers/active_record.rb
@@ -2,7 +2,6 @@
require 'shoulda/matchers/active_record/have_db_column_matcher'
require 'shoulda/matchers/active_record/have_db_index_matcher'
require 'shoulda/matchers/active_record/have_readonly_attribute_matcher'
-require 'shoulda/matchers/active_record/have_secure_password_matcher'
require 'shoulda/matchers/active_record/serialize_matcher'
module Shoulda
View
2  ...ctive_record/have_secure_password_matcher_spec.rb → ...active_model/have_secure_password_matcher_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Shoulda::Matchers::ActiveRecord::HaveSecurePasswordMatcher do
+describe Shoulda::Matchers::ActiveModel::HaveSecurePasswordMatcher do
context "a model that does have secure password" do
before do
define_model :example do
Please sign in to comment.
Something went wrong with that request. Please try again.