2020-06-05 11:08:23 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-08-18 14:10:07 -04:00
|
|
|
require 'rubocop_spec_helper'
|
2020-06-05 11:08:23 -04:00
|
|
|
require_relative '../../../../rubocop/cop/gitlab/bulk_insert'
|
|
|
|
|
2021-01-07 13:10:38 -05:00
|
|
|
RSpec.describe RuboCop::Cop::Gitlab::BulkInsert do
|
2021-11-15 10:10:57 -05:00
|
|
|
it 'flags the use of ApplicationRecord.legacy_bulk_insert' do
|
2020-06-05 11:08:23 -04:00
|
|
|
expect_offense(<<~SOURCE)
|
2021-11-15 10:10:57 -05:00
|
|
|
ApplicationRecord.legacy_bulk_insert('merge_request_diff_files', rows)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the `BulkInsertSafe` concern, [...]
|
2020-09-14 23:09:24 -04:00
|
|
|
SOURCE
|
|
|
|
end
|
|
|
|
|
2021-11-15 10:10:57 -05:00
|
|
|
it 'flags the use of ::ApplicationRecord.legacy_bulk_insert' do
|
2020-09-14 23:09:24 -04:00
|
|
|
expect_offense(<<~SOURCE)
|
2021-11-15 10:10:57 -05:00
|
|
|
::ApplicationRecord.legacy_bulk_insert('merge_request_diff_files', rows)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the `BulkInsertSafe` concern, [...]
|
2020-06-05 11:08:23 -04:00
|
|
|
SOURCE
|
|
|
|
end
|
|
|
|
end
|