gitlab-org--gitlab-foss/db/fixtures/development/18_abuse_reports.rb
Rémy Coutable d7e3fadb42
Ensure we generate unique usernames otherwise validations fail
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-04 08:48:49 +02:00

27 lines
747 B
Ruby

module Db
module Fixtures
module Development
class AbuseReport
def self.seed
Gitlab::Seeder.quiet do
(::AbuseReport.default_per_page + 3).times do |i|
reported_user =
::User.create!(
username: "reported_user_#{i}",
name: FFaker::Name.name,
email: FFaker::Internet.email,
confirmed_at: DateTime.now,
password: '12345678'
)
::AbuseReport.create(reporter: ::User.take, user: reported_user, message: 'User sends spam')
print '.'
end
end
end
end
end
end
end
Db::Fixtures::Development::AbuseReport.seed