Sha256: 68af0f460b8134657b33dc3acc0d52279caba90c8fd114f03291b03adf18d1df
Contents?: true
Size: 689 Bytes
Versions: 3
Compression:
Stored size: 689 Bytes
Contents
require 'spec_helper' module CryptKeeper::LogSubscriber describe MysqlAes do use_postgres subject { ::ActiveRecord::LogSubscriber.new } let(:input_query) do "SELECT AES_ENCRYPT('encrypt_value', 'encrypt_key'), AES_ENCRYPT('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: output_query })) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
crypt_keeper-0.7.0 | spec/log_subscriber/mysql_aes_spec.rb |
crypt_keeper-0.6.1 | spec/log_subscriber/mysql_aes_spec.rb |
crypt_keeper-0.6.0 | spec/log_subscriber/mysql_aes_spec.rb |