Add tests for disable_quote option
This commit is contained in:
parent
74b3870a95
commit
71d2704418
1 changed files with 16 additions and 0 deletions
|
@ -199,6 +199,22 @@ describe Gitlab::Database do
|
|||
described_class.bulk_insert('test', rows)
|
||||
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
|
||||
expect { described_class.bulk_insert('test', [{ a: "\255" }]) }.not_to raise_error
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue