Ensure we generate unique usernames otherwise validations fail

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-04-04 08:48:49 +02:00
parent fa65b65b0f
commit d7e3fadb42
No known key found for this signature in database
GPG key ID: 46DF07E5CD9E96AB
2 changed files with 3 additions and 3 deletions

View file

@ -4,10 +4,10 @@ module Db
class AbuseReport class AbuseReport
def self.seed def self.seed
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
(::AbuseReport.default_per_page + 3).times do (::AbuseReport.default_per_page + 3).times do |i|
reported_user = reported_user =
::User.create!( ::User.create!(
username: "#{FFaker::Internet.user_name}-reported", username: "reported_user_#{i}",
name: FFaker::Name.name, name: FFaker::Name.name,
email: FFaker::Internet.email, email: FFaker::Internet.email,
confirmed_at: DateTime.now, confirmed_at: DateTime.now,

View file

@ -3,7 +3,7 @@ require 'spec_helper'
describe API::V3::Members, api: true do describe API::V3::Members, api: true do
include ApiHelpers include ApiHelpers
let(:master) { create(:user) } let(:master) { create(:user, username: 'master_user') }
let(:developer) { create(:user) } let(:developer) { create(:user) }
let(:access_requester) { create(:user) } let(:access_requester) { create(:user) }
let(:stranger) { create(:user) } let(:stranger) { create(:user) }