summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/abuse_report.rb2
-rw-r--r--spec/models/abuse_report_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb
index 2bc15c60d57..cc59aa4e911 100644
--- a/app/models/abuse_report.rb
+++ b/app/models/abuse_report.rb
@@ -17,7 +17,7 @@ class AbuseReport < ActiveRecord::Base
validates :reporter, presence: true
validates :user, presence: true
validates :message, presence: true
- validates :user_id, uniqueness: true
+ validates :user_id, uniqueness: { message: 'has already been reported' }
def remove_user
user.block
diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb
index f9be8fcbcfe..4799bbaa57c 100644
--- a/spec/models/abuse_report_spec.rb
+++ b/spec/models/abuse_report_spec.rb
@@ -26,7 +26,7 @@ RSpec.describe AbuseReport, type: :model do
it { is_expected.to validate_presence_of(:reporter) }
it { is_expected.to validate_presence_of(:user) }
it { is_expected.to validate_presence_of(:message) }
- it { is_expected.to validate_uniqueness_of(:user_id) }
+ it { is_expected.to validate_uniqueness_of(:user_id).with_message('has already been reported') }
end
describe '#remove_user' do