diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-04 15:12:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-04 15:12:44 +0300 |
commit | 157061839634d24bdb937316373f35bf1fb1f71e (patch) | |
tree | cfdf79f0a03d105c7cc2c66805e164f68d77d92c /spec/models | |
parent | 6974ffffd292657d8257826b2e09a0a8fff6c6a8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/application_setting_spec.rb | 10 | ||||
-rw-r--r-- | spec/models/ci/catalog/listing_spec.rb | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 68915515818..5a91553a923 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -1660,17 +1660,17 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do end context 'with plaintext token only' do - let(:token) { '' } + let(:plaintext_token) { Devise.friendly_token(20) } - it 'ignores the plaintext token' do + it 'encrypts the plaintext token' do subject - described_class.update_all(static_objects_external_storage_auth_token: 'Test') + described_class.update!(static_objects_external_storage_auth_token: plaintext_token) setting.reload expect(setting[:static_objects_external_storage_auth_token]).to be_nil - expect(setting[:static_objects_external_storage_auth_token_encrypted]).to be_nil - expect(setting.static_objects_external_storage_auth_token).to be_nil + expect(setting[:static_objects_external_storage_auth_token_encrypted]).not_to be_nil + expect(setting.static_objects_external_storage_auth_token).to eq(plaintext_token) end end end diff --git a/spec/models/ci/catalog/listing_spec.rb b/spec/models/ci/catalog/listing_spec.rb index 75188232dba..2d20acd4091 100644 --- a/spec/models/ci/catalog/listing_spec.rb +++ b/spec/models/ci/catalog/listing_spec.rb @@ -76,7 +76,8 @@ RSpec.describe Ci::Catalog::Listing, feature_category: :pipeline_composition do context 'when the `ci_guard_query_for_catalog_resource_scope` ff is enabled' do it "returns the catalog resources belonging to the user's authorized namespaces" do - is_expected.to contain_exactly(public_resource_a, public_resource_b, internal_resource) + is_expected.to contain_exactly(public_resource_a, public_resource_b, internal_resource, + private_namespace_resource) end end |