diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/services/design_management/save_designs_service_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/services/design_management/save_designs_service_spec.rb')
-rw-r--r-- | spec/services/design_management/save_designs_service_spec.rb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/spec/services/design_management/save_designs_service_spec.rb b/spec/services/design_management/save_designs_service_spec.rb index c69df5f2eb9..a87494d87f7 100644 --- a/spec/services/design_management/save_designs_service_spec.rb +++ b/spec/services/design_management/save_designs_service_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe DesignManagement::SaveDesignsService do +RSpec.describe DesignManagement::SaveDesignsService, feature_category: :design_management do include DesignManagementTestHelpers include ConcurrentHelpers @@ -242,6 +242,27 @@ RSpec.describe DesignManagement::SaveDesignsService do expect(updated_designs.first.versions.size).to eq(1) end end + + context 'when detecting content type' do + it 'detects content type when feature flag is enabled' do + expect_next_instance_of(::Lfs::FileTransformer) do |file_transformer| + expect(file_transformer).to receive(:new_file) + .with(anything, anything, hash_including(detect_content_type: true)).and_call_original + end + + run_service + end + + it 'skips content type detection when feature flag is disabled' do + stub_feature_flags(design_management_allow_dangerous_images: false) + expect_next_instance_of(::Lfs::FileTransformer) do |file_transformer| + expect(file_transformer).to receive(:new_file) + .with(anything, anything, hash_including(detect_content_type: false)).and_call_original + end + + run_service + end + end end context 'when a design has not changed since its previous version' do |