diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-16 09:10:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-16 09:10:00 +0300 |
commit | 0e0890828e6574c6bbc3fd2518fe8ffb5a3dd13e (patch) | |
tree | d992c47e17e8cc28939fc486f33ed384c092e422 /spec | |
parent | f0abe9dd95232062d37f2f5bf832224272b7497c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/profiles/keys_spec.rb | 9 | ||||
-rw-r--r-- | spec/lib/gitlab/database/reindexing_spec.rb | 19 | ||||
-rw-r--r-- | spec/models/concerns/cross_database_modification_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/work_items/export_csv_service_spec.rb | 10 |
4 files changed, 42 insertions, 4 deletions
diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index c2f67f36850..e1c21f2117a 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -122,11 +122,11 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do project.add_developer(user) end - it 'revoking the SSH key marks commits as unverified', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/390905' do + it 'revoking the SSH key marks commits as unverified' do visit project_commit_path(project, commit) + wait_for_all_requests - find('a.gpg-status-box', text: 'Verified').click + page.find('a.gpg-status-box', text: 'Verified').click within('.popover') do expect(page).to have_content("Verified commit") @@ -136,8 +136,9 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do destroy_key(profile_keys_path, 'Revoke', 'Revoke') visit project_commit_path(project, commit) + wait_for_all_requests - find('a.gpg-status-box', text: 'Unverified').click + page.find('a.gpg-status-box', text: 'Unverified').click within('.popover') do expect(page).to have_content("Unverified signature") diff --git a/spec/lib/gitlab/database/reindexing_spec.rb b/spec/lib/gitlab/database/reindexing_spec.rb index 6575c92e313..a8af9bb5a38 100644 --- a/spec/lib/gitlab/database/reindexing_spec.rb +++ b/spec/lib/gitlab/database/reindexing_spec.rb @@ -68,6 +68,25 @@ RSpec.describe Gitlab::Database::Reindexing, feature_category: :database, time_t end end end + + context 'when async FK validation is enabled' do + it 'executes FK validation for each database prior to any reindexing actions' do + expect(Gitlab::Database::AsyncForeignKeys).to receive(:validate_pending_entries!).ordered.exactly(databases_count).times + expect(described_class).to receive(:automatic_reindexing).ordered.exactly(databases_count).times + + described_class.invoke + end + end + + context 'when async FK validation is disabled' do + it 'does not execute FK validation' do + stub_feature_flags(database_async_foreign_key_validation: false) + + expect(Gitlab::Database::AsyncForeignKeys).not_to receive(:validate_pending_entries!) + + described_class.invoke + end + end end describe '.automatic_reindexing' do diff --git a/spec/models/concerns/cross_database_modification_spec.rb b/spec/models/concerns/cross_database_modification_spec.rb index c3831b654cf..eaebf613cb5 100644 --- a/spec/models/concerns/cross_database_modification_spec.rb +++ b/spec/models/concerns/cross_database_modification_spec.rb @@ -21,6 +21,14 @@ RSpec.describe CrossDatabaseModification do expect(ApplicationRecord.gitlab_transactions_stack).to be_empty + PackageMetadata::ApplicationRecord.transaction do + expect(ApplicationRecord.gitlab_transactions_stack).to contain_exactly(:gitlab_pm) + + Project.first + end + + expect(ApplicationRecord.gitlab_transactions_stack).to be_empty + Project.transaction do expect(ApplicationRecord.gitlab_transactions_stack).to contain_exactly(:gitlab_main) diff --git a/spec/services/work_items/export_csv_service_spec.rb b/spec/services/work_items/export_csv_service_spec.rb index fdf195fa9fd..0718d3b686a 100644 --- a/spec/services/work_items/export_csv_service_spec.rb +++ b/spec/services/work_items/export_csv_service_spec.rb @@ -15,6 +15,16 @@ RSpec.describe WorkItems::ExportCsvService, :with_license, feature_category: :te CSV.parse(subject.csv_data, headers: true) end + context 'when import_export_work_items_csv flag is not enabled' do + before do + stub_feature_flags(import_export_work_items_csv: false) + end + + it 'renders an error' do + expect { subject.csv_data }.to raise_error(described_class::NotAvailableError) + end + end + it 'renders csv to string' do expect(subject.csv_data).to be_a String end |