Sha256: ec47ae50f1f5d6f805a8d6bf310d68897b363064d07d948b26101acf9d4b2feb

Contents?: true

Size: 714 Bytes

Versions: 30

Compression:

Stored size: 714 Bytes

Contents

describe MangoPay do
  include_context 'users'
  include_context 'payins'
  require 'json'

  describe 'requests log file' do

    let(:log_file) do
      File.join(MangoPay.configuration.temp_dir, 'mangopay.log.tmp')
    end

    it 'filters confidential parameters' do
      FileUtils.rm_f(log_file)
      MangoPay.configuration.log_file = log_file
      created = new_card_registration
      lines = File.open(log_file).select { |l| l.include?('AccessKey') }
      lines.each do |line|
        result = JSON.load(/({.+})\s+$/.match(line)[0])
        expect(result['AccessKey']).to eq('[FILTERED]')
        expect(result['Id']).not_to eq('[FILTERED]')
      end
      FileUtils.rm_f(log_file)
    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mangopay-3.28.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.27.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.26.1 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.26.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.25.1 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.25.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.24.1 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.24.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.23.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.22.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.21.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.20.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.19.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.18.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.17.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.16.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.15.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.14.0 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.13.2 spec/mangopay/log_requests_filter_spec.rb
mangopay-3.12.0 spec/mangopay/log_requests_filter_spec.rb