Sha256: ad9aa1314c020174bca623a24bc1a40c2af048e0ef1a88896eb87f7b5439baf1
Contents?: true
Size: 824 Bytes
Versions: 5
Compression:
Stored size: 824 Bytes
Contents
require 'spec_helper' module CryptKeeper::LogSubscriber describe PostgresPgp do use_postgres # Fire the ActiveSupport.on_load before do CryptKeeper::Provider::PostgresPgp.new key: 'secret' end subject { ::ActiveRecord::LogSubscriber.new } let(:input_query) do "SELECT pgp_sym_encrypt('encrypt_value', 'encrypt_key'), pgp_sym_decrypt('decrypt_value', 'decrypt_key') FROM DUAL;" end let(:output_query) do "SELECT pgp_sym_encrypt([FILTERED]), pgp_sym_decrypt([FILTERED]) FROM DUAL;" end it "filters pgp functions" do subject.should_receive(:sql_without_postgres_pgp) do |event| event.payload[:sql].should == output_query end subject.sql(ActiveSupport::Notifications::Event.new(:sql, 1, 1, 1, { sql: output_query })) end end end
Version data entries
5 entries across 5 versions & 1 rubygems