Sha256: d3e93e2ce0aec0ed73756bb425739eb07f3ebe3156c0250765daa5a169c48161

Contents?: true

Size: 914 Bytes

Versions: 8

Compression:

Stored size: 914 Bytes

Contents

# frozen_string_literal: true
class FakeClass
  include FinAppsCore::Utils::ParameterFilter
end

RSpec.describe FinAppsCore::Utils::ParameterFilter do
  describe '#skip_sensitive_data' do
    context 'when provided with sensitive data' do
      let(:unfiltered_params) do
        {
          password: 'FinApps@123',
          password_confirm: 'FinApps@123',
          token: '123456',
          login: 'sammysosa',
          username: 'johnny',
          name: 'george'
        }
      end
      let(:filtered_params) do
        {
          password: '[REDACTED]',
          password_confirm: '[REDACTED]',
          token: '[REDACTED]',
          login: '[REDACTED]',
          username: '[REDACTED]',
          name: 'george'
        }
      end

      it 'filters out sensitive values' do
        expect(FakeClass.new.skip_sensitive_data(unfiltered_params)).to eq(filtered_params)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
finapps_core-2.0.13 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.12 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.11 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.10 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.9 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.8 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.7 spec/utils/parameter_filter_spec.rb
finapps_core-2.0.6 spec/utils/parameter_filter_spec.rb