Skip to content

Instantly share code, notes, and snippets.

@jaycfields
Created July 8, 2012 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaycfields/3072090 to your computer and use it in GitHub Desktop.
Save jaycfields/3072090 to your computer and use it in GitHub Desktop.
spy and verify
require 'spec_helper'
describe MyController do
describe "create" do
it "filters sensitive data from the log" do
invocations = Rails.logger.spy_on.add
post :create, :myobj => {:social_security_number => "123-45-6789"}
invocations.grep(/Parameters:/).first.should include('"social_security_number"=>"[FILTERED]"')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment