diff options
author | Stan Hu <stanhu@gmail.com> | 2017-12-07 05:34:58 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-12-07 05:34:58 +0300 |
commit | 29e39e55c3d4b5c6c34c6faec84b0dcd5a3efffa (patch) | |
tree | d6b3ca53d05fa47db768c8d0508fe51c81b0f6ac /spec/lib/gitlab/database_spec.rb | |
parent | ba44a57f101a87ebb9155485d5bde1287f7892cf (diff) | |
parent | 24c348f0d1270fe27268aa23e034473651b0cdf9 (diff) |
Merge branch 'mk-add-old-attachments-to-uploads-table' into 'master'
Add old files to uploads table
See merge request gitlab-org/gitlab-ce!15270
Diffstat (limited to 'spec/lib/gitlab/database_spec.rb')
-rw-r--r-- | spec/lib/gitlab/database_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index a5657b81952..b2f13fae73f 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -221,6 +221,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 |