require 'spec_helper' describe Appsignal::ParamsSanitizer do describe ".sanitize" 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', :nested_array_hash_file => file, } ] } } end let(:sanitized_params) { Appsignal::ParamsSanitizer.sanitize(params) } subject { sanitized_params } it { should be_instance_of Hash } it('should have a text') { subject[:text].should == 'string' } it('should have a file') do subject[:file].should be_instance_of String subject[:file].should include '#