summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-04 14:47:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-04 14:47:28 +0000
commit901adec7f6b9d5372de49112ec388ba9007ef4d9 (patch)
treeb2b5dd538671305ff9df45b1b24a9243aab715a1 /spec
parent3bc07a0be9ce3b8f736890a0513283f04796b37e (diff)
downloadgitlab-ce-901adec7f6b9d5372de49112ec388ba9007ef4d9.tar.gz
Add latest changes from gitlab-org/gitlab@14-6-stable-ee
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/pages_domains.rb12
-rw-r--r--spec/factories_spec.rb1
-rw-r--r--spec/fixtures/ssl/letsencrypt_expired_x3.pem98
-rw-r--r--spec/frontend/editor/source_editor_instance_spec.js11
-rw-r--r--spec/models/pages_domain_spec.rb13
-rw-r--r--spec/services/merge_requests/squash_service_spec.rb16
6 files changed, 27 insertions, 124 deletions
diff --git a/spec/factories/pages_domains.rb b/spec/factories/pages_domains.rb
index f3f2af79b76..2ba5cbb48bf 100644
--- a/spec/factories/pages_domains.rb
+++ b/spec/factories/pages_domains.rb
@@ -258,18 +258,6 @@ ZDXgrA==
certificate_source { :gitlab_provided }
end
- # This contains:
- # webdioxide.com
- # Let's Encrypt R3
- # ISRG Root X1 (issued by DST Root CA X3)
- #
- # DST Root CA X3 expired on 2021-09-30, but ISRG Root X1 should be trusted on most systems.
- trait :letsencrypt_expired_x3_root do
- certificate do
- File.read(Rails.root.join('spec/fixtures/ssl', 'letsencrypt_expired_x3.pem'))
- end
- end
-
trait :explicit_ecdsa do
certificate do
'-----BEGIN CERTIFICATE-----
diff --git a/spec/factories_spec.rb b/spec/factories_spec.rb
index 811ed18dce3..08286f57b3b 100644
--- a/spec/factories_spec.rb
+++ b/spec/factories_spec.rb
@@ -31,7 +31,6 @@ RSpec.describe 'factories' do
[:pages_domain, :with_trusted_chain],
[:pages_domain, :with_trusted_expired_chain],
[:pages_domain, :explicit_ecdsa],
- [:pages_domain, :letsencrypt_expired_x3_root],
[:project_member, :blocked],
[:remote_mirror, :ssh],
[:user_preference, :only_comments],
diff --git a/spec/fixtures/ssl/letsencrypt_expired_x3.pem b/spec/fixtures/ssl/letsencrypt_expired_x3.pem
deleted file mode 100644
index 462df721ed7..00000000000
--- a/spec/fixtures/ssl/letsencrypt_expired_x3.pem
+++ /dev/null
@@ -1,98 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIGJDCCBQygAwIBAgISBOSAE/WwQGsTbDJI1vDL9+eKMA0GCSqGSIb3DQEBCwUA
-MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD
-EwJSMzAeFw0yMTEwMDEyMjIxMTlaFw0yMTEyMzAyMjIxMThaMBkxFzAVBgNVBAMT
-DndlYmRpb3hpZGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA
-wf/TpE5AjzoLXMFQ+WHle7Dn5rlEe0bPee2JU386cZmMYnGFS5DR251FerSX28U4
-pqk2yS8oefHGi2PS6h8/MWxr+Zy/6hk3WkgwdIK3uPiUcfCdPV/btXDd4YqikEDm
-BoOE4fQlqKQwtLOnhEZu9y8FQoxxoQ+7DndHrDixDoMbpUloxpqUZwziQnH4QHXE
-32rQhq25+NUK/lVFGKOFnmZ2s/yUildKafqulHrLHOhumKMOEivzlFDZbtqP+RKt
-nsrJ3i9O+nSQz6j5dv3Du6eaResrtK7tT1MFDNhcg2cgjNW64VLXQdFXYXE1OYsw
-yAuXUnHNzWFhinyf80qeh2046YR21dlG8voIDQH4fGG5GmWLyu7glsWYVwQQ36VA
-TTxPmAoaqUTl8A7cnlJpAo+BJ00mS/9DwJ7pkgGC7dYOhJzWlI7lPqzEfmJ+o8pj
-CJlLIuqsn0vcCZQlmqCFMxK4asn+puLLnMjRLHIYEJKDNyPGHQEr2e5t4GUYZKaN
-MEpXMwJd97tUamUKWeBPNIND/kOuqex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BRjCCAUIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
-SwYIKwYBBQUHAQEEPzA9MDsGCCsGAQUFBzAChi9odHRwOi8vYXBwcy5pZGVudHJ1
-c3QuY29tL3Jvb3RzL2RzdHJvb3RjYXgzLnA3YzAfBgNVHSMEGDAWgBTEp7Gkeyxx
-+tvhS5B1/8QVYIWJEDBUBgNVHSAETTBLMAgGBmeBDAECATA/BgsrBgEEAYLfEwEB
-ATAwMC4GCCsGAQUFBwIBFiJodHRwOi8vY3BzLnJvb3QteDEubGV0c2VuY3J5cHQu
-b3JnMDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuaWRlbnRydXN0LmNvbS9E
-U1RST09UQ0FYM0NSTC5jcmwwHQYDVR0OBBYEFHm0WeZ7tuXkAXOACIjIGlj26Ztu
-MA0GCSqGSIb3DQEBCwUAA4IBAQAKcwBslm7/DlLQrt2M51oGrS+o44+/yQoDFVDC
-5WxCu2+b9LRPwkSICHXM6webFGJueN7sJ7o5XPWioW5WlHAQU7G75K/QosMrAdSW
-9MUgNTP52GE24HGNtLi1qoJFlcDyqSMo59ahy2cI2qBDLKobkx/J3vWraV0T9VuG
-WCLKTVXkcGdtwlfFRjlBz4pYg1htmf5X6DYO8A4jqv2Il9DjXA6USbW1FzXSLr9O
-he8Y4IWS6wY7bCkjCWDcRQJMEhg76fsO3txE+FiYruq9RUWhiF1myv4Q6W+CyBFC
-Dfvp7OOGAN6dEOM4+qR9sdjoSYKEBpsr6GtPAQw4dy753ec5
------END CERTIFICATE-----
diff --git a/spec/frontend/editor/source_editor_instance_spec.js b/spec/frontend/editor/source_editor_instance_spec.js
index f9518743ef8..99c4ff4f3fa 100644
--- a/spec/frontend/editor/source_editor_instance_spec.js
+++ b/spec/frontend/editor/source_editor_instance_spec.js
@@ -277,6 +277,17 @@ describe('Source Editor Instance', () => {
expect(extensionStore.set).toHaveBeenCalledWith('SEClassExtension', extension1);
});
+ it('correctly registers methods from the existing extension on an instance', () => {
+ const seInstance2 = new SourceEditorInstance({}, extensionStore);
+ seInstance.use({ definition: SEClassExtension });
+ const val1 = seInstance.classExtMethod();
+
+ seInstance2.use({ definition: SEClassExtension });
+
+ expect(seInstance2.classExtMethod).toBeDefined();
+ expect(seInstance2.classExtMethod()).toBe(val1); // from helpers.js we know classExtMethod()returns a string. Hence `toBe`
+ });
+
it.each`
desc | currentSetupOptions | newSetupOptions | expectedCallTimes
${'updates'} | ${undefined} | ${defSetupOptions} | ${2}
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb
index d476e18a72c..8a5b1e73194 100644
--- a/spec/models/pages_domain_spec.rb
+++ b/spec/models/pages_domain_spec.rb
@@ -287,19 +287,6 @@ RSpec.describe PagesDomain do
it { is_expected.to be_truthy }
end
-
- # The LetsEncrypt DST Root CA X3 expired on 2021-09-30, but the
- # cross-sign in ISRG Root X1 enables it to function provided a chain
- # of trust can be established with the system store. See:
- #
- # 1. https://community.letsencrypt.org/t/production-chain-changes/150739
- # 2. https://letsencrypt.org/2020/12/21/extending-android-compatibility.html
- # 3. https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
- context 'with a LetsEncrypt bundle with an expired DST Root CA X3' do
- let(:domain) { build(:pages_domain, :letsencrypt_expired_x3_root) }
-
- it { is_expected.to be_truthy }
- end
end
describe '#expired?' do
diff --git a/spec/services/merge_requests/squash_service_spec.rb b/spec/services/merge_requests/squash_service_spec.rb
index af48e8f5dae..4b21812503e 100644
--- a/spec/services/merge_requests/squash_service_spec.rb
+++ b/spec/services/merge_requests/squash_service_spec.rb
@@ -76,6 +76,22 @@ RSpec.describe MergeRequests::SquashService do
service.execute
end
end
+
+ context 'when squash message matches commit message but without trailing new line' do
+ let(:service) { described_class.new(project: project, current_user: user, params: { merge_request: merge_request, squash_commit_message: merge_request.first_commit.safe_message.strip }) }
+
+ it 'returns that commit SHA' do
+ result = service.execute
+
+ expect(result).to match(status: :success, squash_sha: merge_request.diff_head_sha)
+ end
+
+ it 'does not perform any git actions' do
+ expect(repository).not_to receive(:squash)
+
+ service.execute
+ end
+ end
end
context 'the squashed commit' do