diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-09 12:07:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-09 12:07:31 +0000 |
commit | 1935f3e81b99c00697bf0b4d6a44d64068b34745 (patch) | |
tree | e2c42218945d0ae19c4566e844d4707513cc2fd6 /spec/models/user_spec.rb | |
parent | a352bc8e72b948a834b0569d0d4288e95a9c529e (diff) | |
download | gitlab-ce-1935f3e81b99c00697bf0b4d6a44d64068b34745.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 3be7240fa16..1c32c0f8f98 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -251,22 +251,22 @@ RSpec.describe User do end end - describe '#abuse_report' do + describe '#abuse_reports' do let(:current_user) { create(:user) } let(:other_user) { create(:user) } - it { is_expected.to have_one(:abuse_report) } + it { is_expected.to have_many(:abuse_reports) } it 'refers to the abuse report whose user_id is the current user' do abuse_report = create(:abuse_report, reporter: other_user, user: current_user) - expect(current_user.abuse_report).to eq(abuse_report) + expect(current_user.abuse_reports.last).to eq(abuse_report) end it 'does not refer to the abuse report whose reporter_id is the current user' do create(:abuse_report, reporter: current_user, user: other_user) - expect(current_user.abuse_report).to be_nil + expect(current_user.abuse_reports.last).to be_nil end it 'does not update the user_id of an abuse report when the user is updated' do |