summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-06 14:03:27 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-06 14:03:27 +0200
commitcba7f20dc8614d12e3eeda6e14f454aeb22b9b54 (patch)
treef4c13a141c07a8baa0bf404b33ade6cfbd4c4f0e /spec
parentce47dd4bb0c686aee13b309b07eb8f976aa5d547 (diff)
downloadgitlab-ce-cba7f20dc8614d12e3eeda6e14f454aeb22b9b54.tar.gz
Allow users to send abuse reports
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/abuse_reports.rb9
-rw-r--r--spec/models/abuse_report_spec.rb7
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/abuse_reports.rb b/spec/factories/abuse_reports.rb
new file mode 100644
index 00000000000..29fcbc5e197
--- /dev/null
+++ b/spec/factories/abuse_reports.rb
@@ -0,0 +1,9 @@
+# Read about factories at https://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :abuse_report do
+ reporter factory: :user
+ user
+ message 'User sends spam'
+ end
+end
diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb
new file mode 100644
index 00000000000..d83004a8388
--- /dev/null
+++ b/spec/models/abuse_report_spec.rb
@@ -0,0 +1,7 @@
+require 'rails_helper'
+
+RSpec.describe AbuseReport, type: :model do
+ subject { create(:abuse_report) }
+
+ it { expect(subject).to be_valid }
+end