Sha256: 38b46641653761107747d7bab369bc67082a4e616e5689d9d66be6c438fcf4b1

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'spec_helper'

describe 'Encrypted attributes' do
  context "Not encryption" do
    let(:credential) { Credential.new(:email => 'john.smith@example.com') }
    before { credential.password = 'this is not a secret' }
    subject { credential.password }
    it { should eq('this is not a secret') }
  end

  context "Has valid attributes" do
    let(:credential) { Credential.new(:email => 'john.smith@example.com') }
    before { credential.password = 'this is not a secret' }
    subject { credential }
    it { should be_valid }
  end

  context "Has invalid attributes" do
    let(:credential) { Credential.new(:email => 'invalid-address') }
    before { credential.password = '' }
    subject { credential }
    it { should_not be_valid }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-encryptor-0.0.5 spec/encrypted_attributes_spec.rb
mongoid-encryptor-0.0.4 spec/encrypted_attributes_spec.rb