diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-30 10:55:48 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-30 10:55:48 +0300 |
commit | c10d009191b379078d28a7cba5fed4060aa346c8 (patch) | |
tree | f1d9fee213ea95e3b0921ec9eedc790ec764acb7 /spec | |
parent | cc2c513bd5c270212035d0c5d8a00250d7aca05c (diff) | |
parent | 25818bd7ae765422c934d0a32efb4ba353d11183 (diff) |
Merge branch 'sh-disable-batch-load-replace-methods' into 'master'
Disable method replacement in avatar loading
Closes #60903
See merge request gitlab-org/gitlab-ce!27866
Diffstat (limited to 'spec')
-rw-r--r-- | spec/uploaders/object_storage_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/uploaders/object_storage_spec.rb b/spec/uploaders/object_storage_spec.rb index 9ce9a353913..a62830c35f1 100644 --- a/spec/uploaders/object_storage_spec.rb +++ b/spec/uploaders/object_storage_spec.rb @@ -771,6 +771,14 @@ describe ObjectStorage do expect { avatars }.not_to exceed_query_limit(1) end + it 'does not attempt to replace methods' do + models.each do |model| + expect(model.avatar.upload).to receive(:method_missing).and_call_original + + model.avatar.upload.path + end + end + it 'fetches a unique upload for each model' do expect(avatars.map(&:url).uniq).to eq(avatars.map(&:url)) expect(avatars.map(&:upload).uniq).to eq(avatars.map(&:upload)) |