Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-01-05 02:59:42 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-01-05 02:59:42 +0300
commit46a220ae3c0e646aac63a3230399fcc8979df6ec (patch)
treee58ef33e0afb682cc746220cdeebd0221173e93e /spec/models/abuse_report_spec.rb
parent01248d205103fe6c408e914e8943873ceb7acb2a (diff)
Add `AbuseReport#notify`
Tell, Don't Ask.
Diffstat (limited to 'spec/models/abuse_report_spec.rb')
-rw-r--r--spec/models/abuse_report_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb
index d45319b25d4..46cab1644c7 100644
--- a/spec/models/abuse_report_spec.rb
+++ b/spec/models/abuse_report_spec.rb
@@ -28,4 +28,21 @@ RSpec.describe AbuseReport, type: :model do
it { is_expected.to validate_presence_of(:message) }
it { is_expected.to validate_uniqueness_of(:user_id) }
end
+
+ describe '#notify' do
+ it 'delivers' do
+ expect(AbuseReportMailer).to receive(:notify).with(subject.id).
+ and_return(spy)
+
+ subject.notify
+ end
+
+ it 'returns early when not persisted' do
+ report = build(:abuse_report)
+
+ expect(AbuseReportMailer).not_to receive(:notify)
+
+ report.notify
+ end
+ end
end