Permalink
Browse files

Move HaveSecurePasswordMatcher to ActiveModel directory and rename re…

…ferences accordingly
  • Loading branch information...
jwulff committed Dec 20, 2011
1 parent 4610354 commit 3fcc3cf75cceab0917220f2e5d43af92ba0fb59c
@@ -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'
@@ -1,19 +1,18 @@
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
end
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
@@ -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
@@ -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

0 comments on commit 3fcc3cf

Please sign in to comment.