Sha256: d73694b28bea345e701a8c34c976993f0f4efbe0731cc8c553b25414de1cce02

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

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

describe "Symmetric encryption" do
  let(:credential) { SymmetricCredential.create(:email => 'john.smith@example.com', :password => 'this is a secret') }

  context "'this is a secret'" do
    subject { credential.password }
    it { should eq("y3HnNrU0HviAl3aw2sWH1KttBLsCLYP1\n") }
    it { should be_encrypted }
    it { should eq('this is a secret') }
  end

  context 'cipher' do
    subject { credential.password.cipher }
    it { should be_an_instance_of(EncryptedStrings::SymmetricCipher) }
  end

  context 'cipher password' do
    subject { credential.password.cipher.password }
    it { should eq('key') }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-encryptor-0.0.5 spec/symmetric_encryption_spec.rb
mongoid-encryptor-0.0.4 spec/symmetric_encryption_spec.rb
mongoid-encryptor-0.0.1 spec/symmetric_encryption_spec.rb