FIX: Regression where api_key is not filtered properly.

This commit is contained in:
Guo Xiang Tan
2016-09-23 11:34:35 +08:00
parent 0c4e4406a1
commit 4895723f7b
3 changed files with 171 additions and 158 deletions

View File

@ -0,0 +1,13 @@
require 'rails_helper'
require_relative '../lib/log_analyzer'
describe LogAnalyzer::LineParser do
describe '.parse' do
let(:line) { '[22/Sep/2016:07:32:00 +0000] 172.0.0.1 "GET /about.json?api_username=system&api_key=1234567 HTTP/1.1" "Some usename" "about/index" 200 1641 "-" 0.014 0.014 "system"' }
it "should filter out the api_key" do
result = described_class.parse(line)
expect(result.url).to eq('GET /about.json?api_username=system&api_key=[FILTERED] HTTP/1.1')
end
end
end