diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-29 13:40:08 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-29 13:40:08 +0100 |
commit | 03478e6d5b98a723fbb349dac2c8495f75909a08 (patch) | |
tree | 32efd1ea84514b93f1597baacba7682711f044c0 /spec/lib/gitlab/metrics | |
parent | 58bc4b72d519d971be7c3eb80f174d9e22f2a1b2 (diff) | |
download | gitlab-ce-03478e6d5b98a723fbb349dac2c8495f75909a08.tar.gz |
Strip newlines from obfuscated SQL
Newlines aren't really needed and they may mess with InfluxDB's line
protocol.
Diffstat (limited to 'spec/lib/gitlab/metrics')
-rw-r--r-- | spec/lib/gitlab/metrics/obfuscated_sql_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/gitlab/metrics/obfuscated_sql_spec.rb b/spec/lib/gitlab/metrics/obfuscated_sql_spec.rb index 0f01ee588c9..2b681c9fe34 100644 --- a/spec/lib/gitlab/metrics/obfuscated_sql_spec.rb +++ b/spec/lib/gitlab/metrics/obfuscated_sql_spec.rb @@ -2,6 +2,12 @@ require 'spec_helper' describe Gitlab::Metrics::ObfuscatedSQL do describe '#to_s' do + it 'replaces newlines with a space' do + sql = described_class.new("SELECT x\nFROM y") + + expect(sql.to_s).to eq('SELECT x FROM y') + end + describe 'using single values' do it 'replaces a single integer' do sql = described_class.new('SELECT x FROM y WHERE a = 10') |