Sha256: f0403cb627753cd51889d4e9862fe7fa4d036aa59563ae6ad3255306d900b68e

Contents?: true

Size: 467 Bytes

Versions: 6

Compression:

Stored size: 467 Bytes

Contents

require 'spec_helper'

describe Mongoid::Kms do

  it "encrypts the secure fields" do
    o = MyClass.new(secure: "batman", unsecure: "robin")
    o.save!

    expect(o.secure).to eq("batman")
    expect(o.kms_secure_secure).to_not be_nil
  end

  it "descripts the secure fields" do
    o = MyClass.new(secure: "batman", unsecure: "robin")
    o.save!

    o = MyClass.find(o.id)
    expect(o.secure).to eq("batman")
    expect(o.unsecure).to eq("robin")
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongoid-kms-0.0.13 spec/lib/mongoid/kms_spec.rb
mongoid-kms-0.0.12 spec/lib/mongoid/kms_spec.rb
mongoid-kms-0.0.11 spec/lib/mongoid/kms_spec.rb
mongoid-kms-0.0.10 spec/lib/mongoid/kms_spec.rb
mongoid-kms-0.0.9 spec/lib/mongoid/kms_spec.rb
mongoid-kms-0.0.8 spec/lib/mongoid/kms_spec.rb