diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-15 12:07:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-15 12:07:57 +0300 |
commit | 5a14a0fe63ac7dace9821be554ad3b3951529708 (patch) | |
tree | 44804ea0e8e62f858c82566301acc0111452103f /spec/models | |
parent | b4610c51192adc832d25192038a781d2aa1ebb98 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/integrations/mattermost_slash_commands_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/integrations/microsoft_teams_spec.rb | 25 | ||||
-rw-r--r-- | spec/models/issue_spec.rb | 19 | ||||
-rw-r--r-- | spec/models/lfs_object_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/loose_foreign_keys/deleted_record_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/member_spec.rb | 14 | ||||
-rw-r--r-- | spec/models/members/group_member_spec.rb | 3 | ||||
-rw-r--r-- | spec/models/members/project_member_spec.rb | 5 | ||||
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/namespace/package_setting_spec.rb | 12 |
10 files changed, 53 insertions, 55 deletions
diff --git a/spec/models/integrations/mattermost_slash_commands_spec.rb b/spec/models/integrations/mattermost_slash_commands_spec.rb index e393a905f45..3dee8737067 100644 --- a/spec/models/integrations/mattermost_slash_commands_spec.rb +++ b/spec/models/integrations/mattermost_slash_commands_spec.rb @@ -20,11 +20,13 @@ RSpec.describe Integrations::MattermostSlashCommands, feature_category: :integra describe '#configure' do subject do - integration.configure(user, - team_id: 'abc', - trigger: 'gitlab', - url: 'http://trigger.url', - icon_url: 'http://icon.url/icon.png') + integration.configure( + user, + team_id: 'abc', + trigger: 'gitlab', + url: 'http://trigger.url', + icon_url: 'http://icon.url/icon.png' + ) end context 'when the request succeeds' do diff --git a/spec/models/integrations/microsoft_teams_spec.rb b/spec/models/integrations/microsoft_teams_spec.rb index a0748ee79cd..f1d9071d232 100644 --- a/spec/models/integrations/microsoft_teams_spec.rb +++ b/spec/models/integrations/microsoft_teams_spec.rb @@ -133,10 +133,13 @@ RSpec.describe Integrations::MicrosoftTeams do context 'when commit comment event executed' do let(:commit_note) do - create(:note_on_commit, author: user, - project: project, - commit_id: project.repository.commit.id, - note: 'a comment on a commit') + create( + :note_on_commit, + author: user, + project: project, + commit_id: project.repository.commit.id, + note: 'a comment on a commit' + ) end it "calls Microsoft Teams API for commit comment events" do @@ -150,8 +153,7 @@ RSpec.describe Integrations::MicrosoftTeams do context 'when merge request comment event executed' do let(:merge_request_note) do - create(:note_on_merge_request, project: project, - note: "merge request note") + create(:note_on_merge_request, project: project, note: "merge request note") end it "calls Microsoft Teams API for merge request comment events" do @@ -179,8 +181,7 @@ RSpec.describe Integrations::MicrosoftTeams do context 'when snippet comment event executed' do let(:snippet_note) do - create(:note_on_project_snippet, project: project, - note: "snippet note") + create(:note_on_project_snippet, project: project, note: "snippet note") end it "calls Microsoft Teams API for snippet comment events" do @@ -197,9 +198,11 @@ RSpec.describe Integrations::MicrosoftTeams do let_it_be_with_refind(:project) { create(:project, :repository) } let(:pipeline) do - create(:ci_pipeline, - project: project, status: status, - sha: project.commit.sha, ref: project.default_branch) + create( + :ci_pipeline, + project: project, status: status, + sha: project.commit.sha, ref: project.default_branch + ) end before do diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 14d885892ed..ee47f90fb40 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -1167,10 +1167,12 @@ RSpec.describe Issue, feature_category: :team_planning do issue = create(:issue, project: project) user = create(:user) - create(:note_on_issue, - noteable: issue, - project: project, - note: user.to_reference) + create( + :note_on_issue, + noteable: issue, + project: project, + note: user.to_reference + ) expect(issue.participants).not_to include(user) end @@ -1423,8 +1425,7 @@ RSpec.describe Issue, feature_category: :team_planning do end it 'checks the external service to determine if an issue is readable by a user' do - project = build(:project, :public, - external_authorization_classification_label: 'a-label') + project = build(:project, :public, external_authorization_classification_label: 'a-label') issue = build(:issue, project: project) user = build(:user) @@ -1434,8 +1435,7 @@ RSpec.describe Issue, feature_category: :team_planning do end it 'does not check the external service if a user does not have access to the project' do - project = build(:project, :private, - external_authorization_classification_label: 'a-label') + project = build(:project, :private, external_authorization_classification_label: 'a-label') issue = build(:issue, project: project) user = build(:user) @@ -1457,8 +1457,7 @@ RSpec.describe Issue, feature_category: :team_planning do context 'when admin mode is disabled' do it 'checks the external service to determine if an issue is readable by the admin' do - project = build(:project, :public, - external_authorization_classification_label: 'a-label') + project = build(:project, :public, external_authorization_classification_label: 'a-label') issue = build(:issue, project: project) user = build(:admin) diff --git a/spec/models/lfs_object_spec.rb b/spec/models/lfs_object_spec.rb index e38ffd97eb9..90672c5e6ec 100644 --- a/spec/models/lfs_object_spec.rb +++ b/spec/models/lfs_object_spec.rb @@ -28,9 +28,7 @@ RSpec.describe LfsObject do lfs_object = create(:lfs_object) project = create(:project) [:project, :design].each do |repository_type| - create(:lfs_objects_project, project: project, - lfs_object: lfs_object, - repository_type: repository_type) + create(:lfs_objects_project, project: project, lfs_object: lfs_object, repository_type: repository_type) end expect(lfs_object.lfs_objects_projects.size).to eq(2) diff --git a/spec/models/loose_foreign_keys/deleted_record_spec.rb b/spec/models/loose_foreign_keys/deleted_record_spec.rb index a909252a78c..2513a9043ad 100644 --- a/spec/models/loose_foreign_keys/deleted_record_spec.rb +++ b/spec/models/loose_foreign_keys/deleted_record_spec.rb @@ -44,9 +44,9 @@ RSpec.describe LooseForeignKeys::DeletedRecord, type: :model do records.each(&:reload) expect(records).to all(have_attributes( - cleanup_attempts: 0, - consume_after: time - )) + cleanup_attempts: 0, + consume_after: time + )) end end diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 6ffb929a7ab..b242de48be0 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -598,15 +598,11 @@ RSpec.describe Member, feature_category: :groups_and_projects do describe '.authorizable' do subject { described_class.authorizable.to_a } - it 'includes the member who has an associated user record,'\ - 'but also having an invite_token' do - member = create(:project_member, - :developer, - :invited, - user: create(:user)) - - expect(subject).to include(member) - end + it 'includes the member who has an associated user record, but also having an invite_token' do + member = create(:project_member, :developer, :invited, user: create(:user)) + + expect(subject).to include(member) + end it { is_expected.to include @owner } it { is_expected.to include @maintainer } diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb index d9420a37879..e197d83b621 100644 --- a/spec/models/members/group_member_spec.rb +++ b/spec/models/members/group_member_spec.rb @@ -21,8 +21,7 @@ RSpec.describe GroupMember, feature_category: :cell do group_1.add_owner(user_2) group_2.add_owner(user_1) - expect(described_class.count_users_by_group_id).to eq(group_1.id => 2, - group_2.id => 1) + expect(described_class.count_users_by_group_id).to eq(group_1.id => 2, group_2.id => 1) end describe '.of_ldap_type' do diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb index 67af7a049cb..3eb34bf9493 100644 --- a/spec/models/members/project_member_spec.rb +++ b/spec/models/members/project_member_spec.rb @@ -208,10 +208,7 @@ RSpec.describe ProjectMember do stub_feature_flags(do_not_run_safety_net_auth_refresh_jobs: false) expect(AuthorizedProjectUpdate::UserRefreshFromReplicaWorker).to( - receive(:bulk_perform_in) - .with(1.hour, - [[user.id]], - batch_delay: 30.seconds, batch_size: 100) + receive(:bulk_perform_in).with(1.hour, [[user.id]], batch_delay: 30.seconds, batch_size: 100) ) action diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 57a9963c0f1..bf9af73fe1b 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -385,8 +385,12 @@ RSpec.describe MergeRequestDiff, feature_category: :code_review_workflow do expect(Compare) .to receive(:new) - .with(instance_of(Gitlab::Git::Compare), merge_request.target_project, - base_sha: diff.base_commit_sha, straight: false) + .with( + instance_of(Gitlab::Git::Compare), + merge_request.target_project, + base_sha: diff.base_commit_sha, + straight: false + ) .and_call_original diff.diffs diff --git a/spec/models/namespace/package_setting_spec.rb b/spec/models/namespace/package_setting_spec.rb index fca929600a4..72ecad42a70 100644 --- a/spec/models/namespace/package_setting_spec.rb +++ b/spec/models/namespace/package_setting_spec.rb @@ -91,11 +91,11 @@ RSpec.describe Namespace::PackageSetting do end describe 'package forwarding attributes' do - %i[maven_package_requests_forwarding - pypi_package_requests_forwarding - npm_package_requests_forwarding].each do |attribute| - it_behaves_like 'a cascading namespace setting boolean attribute', settings_attribute_name: attribute, - settings_association: :package_settings - end + %i[maven_package_requests_forwarding pypi_package_requests_forwarding npm_package_requests_forwarding] + .each do |attribute| + it_behaves_like 'a cascading namespace setting boolean attribute', + settings_attribute_name: attribute, + settings_association: :package_settings + end end end |