Sha256: 56e772a33608a1c82a555058e9ebcc36103fe46fc2959881cf4cad5591df8610

Contents?: true

Size: 804 Bytes

Versions: 11

Compression:

Stored size: 804 Bytes

Contents

require 'spec_helper'

describe Shoulda::Matchers::ActiveModel::HaveSecurePasswordMatcher 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

11 entries across 11 versions & 2 rubygems

Version Path
shoulda-matchers-2.7.0 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.6.2 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
mcmire-shoulda-matchers-2.6.2.docs.1 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
mcmire-shoulda-matchers-2.6.1.docs.1 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.6.1 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.6.1.rc2 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.6.1.rc1 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.6.0 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
mcmire-shoulda-matchers-2.5.0 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.5.0 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb
shoulda-matchers-2.4.0 spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb