require 'spec_helper' describe Appsignal::ParamsSanitizer do let(:file) { ActionDispatch::Http::UploadedFile.new(:tempfile => '/tmp') } let(:params) do { :text => 'string', :file => file, :hash => { :nested_text => 'string', :nested_array => [ 'something', 'else', file, { :key => 'value', :file => file, } ] } } end let(:sanitized_params) { Appsignal::ParamsSanitizer.sanitize(params) } let(:scrubbed_params) { Appsignal::ParamsSanitizer.scrub(params) } describe ".sanitize!" do subject { params } before { Appsignal::ParamsSanitizer.sanitize!(subject) } it { should be_instance_of Hash } its([:text]) { should == 'string' } its([:file]) { should be_instance_of String } its([:file]) { should include '#