Sha256: 04050902b6b822924dbb0c792629e6285d5c61d4b022769e6634201ff80fa4f0
Contents?: true
Size: 801 Bytes
Versions: 1
Compression:
Stored size: 801 Bytes
Contents
require 'spec_helper' module CryptKeeper::LogSubscriber describe MysqlAes do use_mysql # Fire the ActiveSupport.on_load before do CryptKeeper::Provider::MysqlAes.new key: 'secret' end subject { ::ActiveRecord::LogSubscriber.new } let(:input_query) do "SELECT AES_ENCRYPT('encrypt_value', 'encrypt_key'), AES_DECRYPT('decrypt_value', 'decrypt_key') FROM DUAL;" end let(:output_query) do "SELECT AES_ENCRYPT([FILTERED]), AES_DECRYPT([FILTERED]) FROM DUAL;" end it "filters mysql aes functions" do subject.should_receive(:sql_without_mysql_aes) do |event| event.payload[:sql].should == output_query end subject.sql(ActiveSupport::Notifications::Event.new(:sql, 1, 1, 1, { sql: input_query })) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
crypt_keeper-0.15.0.pre | spec/log_subscriber/mysql_aes_spec.rb |