Sha256: fcb9e6400e01e27e613fcb76ca62f6bf55e6dfa6ed1b885927860621abe3d867

Contents?: true

Size: 823 Bytes

Versions: 12

Compression:

Stored size: 823 Bytes

Contents

require 'unit_spec_helper'

describe Shoulda::Matchers::ActiveModel::HaveSecurePasswordMatcher, type: :model do
  if active_model_3_1?
    it 'matches when the subject configures has_secure_password with default options' do
      working_model = define_model(:example, password_digest: :string) { has_secure_password }
      expect(working_model.new).to have_secure_password
    end

    it 'does not match when the subject does not authenticate a password' do
      no_secure_password = define_model(:example)
      expect(no_secure_password.new).not_to have_secure_password
    end

    it 'does not match when the subject is missing the password_digest attribute' do
      no_digest_column = define_model(:example) { has_secure_password }
      expect(no_digest_column.new).not_to have_secure_password
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
shoulda-matchers-3.1.3 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-4.0.0.rc1 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-3.1.2 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-matchers-2.8.0/spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-3.1.1 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-3.1.0 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-3.0.1 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-3.0.0 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-3.0.0.rc1 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.8.0 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.8.0.rc2 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.8.0.rc1 spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb