Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (21 sloc) 0.737 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
require 'spec_helper'

module CryptKeeperProviders
  describe PostgresPgp do
    use_postgres
    let(:cipher_text) { '\\xc30d0407030283b15f71b6a7d0296cd23501bd2c8fe3c7a56005ff4619527c4291509a78c77a6758cddd2a14acbde589fa10b3e0686865182d3beadaf237b9f928e7ba1810b8' }
    let(:plain_text) { 'test' }
    subject { PostgresPgp.new key: 'candy' }

    its(:key) { should == 'candy' }

    describe "#encrypt" do
      it "should encrypt the string" do
        subject.encrypt(plain_text).should_not == plain_text
        subject.encrypt(plain_text).should_not be_empty
      end
    end

    describe "#decrypt" do
      it "should decrypt the string" do
        subject.decrypt(cipher_text).should == plain_text
      end
    end
  end
end
Something went wrong with that request. Please try again.