1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/support/shoulda_matchers.rb

27 lines
645 B
Ruby
Raw Normal View History

2018-11-26 08:38:29 -05:00
# frozen_string_literal: true
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
module Shoulda
module Matchers
module ActiveModel
class ValidatePresenceOfMatcher < ValidationMatcher
def secure_password_being_validated?
return false unless defined?(
::ActiveModel::SecurePassword::InstanceMethodsOnActivation
)
@attribute == :password && @subject.class.ancestors.include?(
::ActiveModel::SecurePassword::InstanceMethodsOnActivation,
)
end
end
end
end
end