Commit 71d27044 authored by Michael Kozono's avatar Michael Kozono

Add tests for disable_quote option

parent 74b3870a
...@@ -199,6 +199,22 @@ describe Gitlab::Database do ...@@ -199,6 +199,22 @@ describe Gitlab::Database do
described_class.bulk_insert('test', rows) described_class.bulk_insert('test', rows)
end end
it 'does not quote values of a column in the disable_quote option' do
[1, 2, 4, 5].each do |i|
expect(connection).to receive(:quote).with(i)
end
described_class.bulk_insert('test', rows, disable_quote: :c)
end
it 'does not quote values of columns in the disable_quote option' do
[2, 5].each do |i|
expect(connection).to receive(:quote).with(i)
end
described_class.bulk_insert('test', rows, disable_quote: [:a, :c])
end
it 'handles non-UTF-8 data' do it 'handles non-UTF-8 data' do
expect { described_class.bulk_insert('test', [{ a: "\255" }]) }.not_to raise_error expect { described_class.bulk_insert('test', [{ a: "\255" }]) }.not_to raise_error
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment