Commit 53e67cc1 authored by Luke Duncalfe's avatar Luke Duncalfe

Call .dup in test to fix broken master

Call `.dup` on the class passed in, as a test in this set of examples
calls `belongs_to` on the class, thereby adding a new belongs_to
relationship to the model that can break remaining specs in the test
suite.

https://gitlab.com/gitlab-org/gitlab/issues/205382
parent 0ecfdd0e
# frozen_string_literal: true
RSpec.shared_examples 'a BulkInsertSafe model' do |target_class|
RSpec.shared_examples 'a BulkInsertSafe model' do |klass|
# Call `.dup` on the class passed in, as a test in this set of examples
# calls `belongs_to` on the class, thereby adding a new belongs_to
# relationship to the model that can break remaining specs in the test suite.
let(:target_class) { klass.dup }
# We consider all callbacks unsafe for bulk insertions unless we have explicitly
# whitelisted them (esp. anything related to :save, :create, :commit etc.)
let(:callback_method_blacklist) do
......
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