spec/outputs/charrington_spec.rb in logstash-output-charrington-0.3.7 vs spec/outputs/charrington_spec.rb in logstash-output-charrington-0.3.9
- old
+ new
@@ -30,9 +30,37 @@
expect(query('SELECT * FROM schemaless')).to match_array([{id: "1", app_name: "Web App", event: "schemaless", inserted_at: a_kind_of(String), :meta_type => "XML"}])
expect(query('SELECT COUNT(1) FROM schemaless').first[:count]).to eq("1")
end
end
+ describe 'removes a trailing plus sign' do
+ let(:config) do
+ <<-CONFIG
+ input {
+ generator {
+ message => '{"app_name": "Web App", "event": "with plus +", "meta": { "type": "XML" } }'
+ codec => 'json'
+ count => 1
+ }
+ }
+
+ output {
+ charrington {
+ connection_string => '#{@url}'
+ driver_jar_path => '#{driver_path}'
+ }
+ }
+ CONFIG
+ end
+
+ it 'creates a table and inserts a record' do
+ drop_table('with_plus')
+ run_pipeline
+ expect(query('SELECT * FROM with_plus')).to match_array([{id: "1", app_name: "Web App", event: "with plus +", inserted_at: a_kind_of(String), :meta_type => "XML"}])
+ expect(query('SELECT COUNT(1) FROM with_plus').first[:count]).to eq("1")
+ end
+ end
+
describe '2 event payloads with different metadata' do
let(:config) do
<<-CONFIG
input {
generator {