diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-16 09:14:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-16 09:14:23 +0300 |
commit | 2800e6ea59112f31833f8241a9a2f04ae8f7faa1 (patch) | |
tree | 23e6c21eb4e8b2eb62049e05375c51710eccfce4 /spec | |
parent | 0e6ff93eba3ed1ba4c7be0ec78a76dde71a47285 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
4 files changed, 32 insertions, 9 deletions
diff --git a/spec/features/projects/blobs/blame_spec.rb b/spec/features/projects/blobs/blame_spec.rb index f50f6911120..5287d5e4f7d 100644 --- a/spec/features/projects/blobs/blame_spec.rb +++ b/spec/features/projects/blobs/blame_spec.rb @@ -38,6 +38,7 @@ RSpec.describe 'File blame', :js do within '[data-testid="blob-content-holder"]' do expect(page).to have_css('.blame-commit') expect(page).not_to have_css('.gl-pagination') + expect(page).not_to have_link _('View entire blame') end end diff --git a/spec/migrations/20220913030624_cleanup_attention_request_related_system_notes_spec.rb b/spec/migrations/20220913030624_cleanup_attention_request_related_system_notes_spec.rb new file mode 100644 index 00000000000..7338a6ab9ae --- /dev/null +++ b/spec/migrations/20220913030624_cleanup_attention_request_related_system_notes_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe CleanupAttentionRequestRelatedSystemNotes, :migration do + let(:notes) { table(:notes) } + let(:system_note_metadata) { table(:system_note_metadata) } + + it 'removes all notes with attention request related system_note_metadata' do + notes.create!(id: 1, note: 'Attention request note', noteable_type: 'MergeRequest') + notes.create!(id: 2, note: 'Attention request remove note', noteable_type: 'MergeRequest') + notes.create!(id: 3, note: 'MergeRequest note', noteable_type: 'MergeRequest') + notes.create!(id: 4, note: 'Commit note', noteable_type: 'Commit') + system_note_metadata.create!(id: 11, action: 'attention_requested', note_id: 1) + system_note_metadata.create!(id: 22, action: 'attention_request_removed', note_id: 2) + system_note_metadata.create!(id: 33, action: 'merged', note_id: 3) + + expect { migrate! }.to change(notes, :count).by(-2) + + expect(system_note_metadata.where(action: %w[attention_requested attention_request_removed]).size).to eq(0) + expect(notes.where(noteable_type: 'MergeRequest').size).to eq(1) + expect(notes.where(noteable_type: 'Commit').size).to eq(1) + expect(system_note_metadata.where(action: 'merged').size).to eq(1) + end +end diff --git a/spec/services/merge_requests/ff_merge_service_spec.rb b/spec/services/merge_requests/ff_merge_service_spec.rb index 24a1a8b3113..aa5d6dcd1fb 100644 --- a/spec/services/merge_requests/ff_merge_service_spec.rb +++ b/spec/services/merge_requests/ff_merge_service_spec.rb @@ -75,6 +75,7 @@ RSpec.describe MergeRequests::FfMergeService do expect(merge_request).to receive(:update_and_mark_in_progress_merge_commit_sha).twice.and_call_original expect { execute_ff_merge }.not_to change { merge_request.squash_commit_sha } + expect(merge_request.merge_commit_sha).to be_nil expect(merge_request.in_progress_merge_commit_sha).to be_nil end @@ -87,6 +88,7 @@ RSpec.describe MergeRequests::FfMergeService do .to change { merge_request.squash_commit_sha } .from(nil) + expect(merge_request.merge_commit_sha).to be_nil expect(merge_request.in_progress_merge_commit_sha).to be_nil end end @@ -106,7 +108,6 @@ RSpec.describe MergeRequests::FfMergeService do service.execute(merge_request) - expect(merge_request.merge_error).to include(error_message) expect(Gitlab::AppLogger).to have_received(:error).with(a_string_matching(error_message)) end @@ -117,11 +118,6 @@ RSpec.describe MergeRequests::FfMergeService do pre_receive_error = Gitlab::Git::PreReceiveError.new(raw_message, fallback_message: error_message) allow(service).to receive(:repository).and_raise(pre_receive_error) allow(service).to receive(:execute_hooks) - expect(Gitlab::ErrorTracking).to receive(:track_exception).with( - pre_receive_error, - pre_receive_message: raw_message, - merge_request_id: merge_request.id - ) service.execute(merge_request) diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index ffd0095e57a..4e8a172177a 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -1080,7 +1080,7 @@ - './ee/spec/helpers/groups/sso_helper_spec.rb' - './ee/spec/helpers/incident_management/escalation_policy_helper_spec.rb' - './ee/spec/helpers/incident_management/oncall_schedule_helper_spec.rb' -- './ee/spec/helpers/kerberos_spnego_helper_spec.rb' +- './ee/spec/helpers/kerberos_helper_spec.rb' - './ee/spec/helpers/license_helper_spec.rb' - './ee/spec/helpers/license_monitoring_helper_spec.rb' - './ee/spec/helpers/manual_quarterly_co_term_banner_helper_spec.rb' @@ -1692,7 +1692,7 @@ - './ee/spec/lib/gitlab/web_ide/config/entry/schema/uri_spec.rb' - './ee/spec/lib/incident_management/oncall_shift_generator_spec.rb' - './ee/spec/lib/omni_auth/strategies/group_saml_spec.rb' -- './ee/spec/lib/omni_auth/strategies/kerberos_spnego_spec.rb' +- './ee/spec/lib/omni_auth/strategies/kerberos_spec.rb' - './ee/spec/lib/peek/views/elasticsearch_spec.rb' - './ee/spec/lib/sidebars/groups/menus/administration_menu_spec.rb' - './ee/spec/lib/sidebars/groups/menus/analytics_menu_spec.rb' @@ -2511,7 +2511,7 @@ - './ee/spec/requests/jwt_controller_spec.rb' - './ee/spec/requests/lfs_http_spec.rb' - './ee/spec/requests/lfs_locks_api_spec.rb' -- './ee/spec/requests/omniauth_kerberos_spnego_spec.rb' +- './ee/spec/requests/omniauth_kerberos_spec.rb' - './ee/spec/requests/projects/analytics/code_reviews_controller_spec.rb' - './ee/spec/requests/projects/audit_events_spec.rb' - './ee/spec/requests/projects/incidents_controller_spec.rb' |