diff options
author | Luke Duncalfe <lduncalfe@gitlab.com> | 2019-06-19 20:51:57 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-06-19 20:51:57 +0300 |
commit | dcf811ba147a9d1c677fa626ca06639783d09717 (patch) | |
tree | 6e114055074385c4d057be651783134ab7b0f6ee /spec | |
parent | 96c2949d6cfae23571f7d24c7b5ad1c22d759670 (diff) |
CE backport for changes in EE MR 14017
This backports to CE changes to allow the EE model
DesignManagement::Repository to override the #attributes_at method to
provide its own git attributes.
The #attributes_at method was freely available, as it's never called by
anything in the app. It looks like the code that called it got
refactored out of existence in ca66a04f. It was still being called in a
spec
https://gitlab.com/gitlab-org/gitlab-ce/blob/85b29c1c2fa3b94d7371cf454c485457a0756cb1/spec/services/files/create_service_spec.rb#L40
which I've left because with the change in Lfs::FileTransformer in fact
is now again the perfect test!
See EE MR
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14017
And these comment threads
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178002089
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178049984
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb b/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb index b7080c68270..d3cadf2ba7c 100644 --- a/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb +++ b/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb @@ -9,7 +9,15 @@ # - `filepath`: path of the file (contains filename) # - `subject`: the request to be made to the controller. Example: # subject { get :show, namespace_id: project.namespace, project_id: project } -shared_examples 'a controller that can serve LFS files' do +# +# The LFS disabled scenario can be skipped by passing `skip_lfs_disabled_tests: true` +# when including the examples (Note, at time of writing this is only used by +# an EE-specific spec): +# +# it_behaves_like 'a controller that can serve LFS files', skip_lfs_disabled_tests: true do +# ... +# end +shared_examples 'a controller that can serve LFS files' do |options = {}| let(:lfs_oid) { '91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897' } let(:lfs_size) { '1575078' } let!(:lfs_object) { create(:lfs_object, oid: lfs_oid, size: lfs_size) } @@ -83,6 +91,8 @@ shared_examples 'a controller that can serve LFS files' do end it 'delivers ASCII file' do + skip 'Calling spec asked to skip testing LFS disabled scenario' if options[:skip_lfs_disabled_tests] + subject expect(response).to have_gitlab_http_status(200) |