diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-03-16 13:34:08 +0100 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-03-16 13:35:27 +0100 |
commit | fb6d6fce5a4d0fd833dc1cd231dd284a6c89471a (patch) | |
tree | cd60653ee507ae673a6da8a12ebd731bf449f525 /spec/support/shared_examples/models/atomic_internal_id_spec.rb | |
parent | bc3fc8ec3eec74876a0e2125248c27cde153e32b (diff) | |
download | gitlab-ce-fb6d6fce5a4d0fd833dc1cd231dd284a6c89471a.tar.gz |
Address review comments.
Diffstat (limited to 'spec/support/shared_examples/models/atomic_internal_id_spec.rb')
-rw-r--r-- | spec/support/shared_examples/models/atomic_internal_id_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/support/shared_examples/models/atomic_internal_id_spec.rb b/spec/support/shared_examples/models/atomic_internal_id_spec.rb index 671aa314bd6..144af4fc475 100644 --- a/spec/support/shared_examples/models/atomic_internal_id_spec.rb +++ b/spec/support/shared_examples/models/atomic_internal_id_spec.rb @@ -24,14 +24,16 @@ shared_examples_for 'AtomicInternalId' do it 'calls InternalId.generate_next and sets internal id attribute' do iid = rand(1..1000) + expect(InternalId).to receive(:generate_next).with(instance, scope_attrs, usage, any_args).and_return(iid) subject - expect(instance.public_send(internal_id_attribute)).to eq(iid) # rubocop:disable GitlabSecurity/PublicSend + expect(instance.public_send(internal_id_attribute)).to eq(iid) end it 'does not overwrite an existing internal id' do - instance.public_send("#{internal_id_attribute}=", 4711) # rubocop:disable GitlabSecurity/PublicSend - expect { subject }.not_to change { instance.public_send(internal_id_attribute) } # rubocop:disable GitlabSecurity/PublicSend + instance.public_send("#{internal_id_attribute}=", 4711) + + expect { subject }.not_to change { instance.public_send(internal_id_attribute) } end end end |