Skip to content

Commit 627a968

Browse files
author
Robert Speicher
committed
Merge branch 'rc/use-factory_bot_rails' into 'master'
Replace factory_girl_rails with factory_bot_rails See merge request gitlab-org/gitlab-ce!15919
2 parents d2f313d + 4af9d59 commit 627a968

File tree

125 files changed

+175
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+175
-175
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ group :development, :test do
311311
gem 'fuubar', '~> 2.2.0'
312312

313313
gem 'database_cleaner', '~> 1.5.0'
314-
gem 'factory_girl_rails', '~> 4.7.0'
314+
gem 'factory_bot_rails', '~> 4.8.2'
315315
gem 'rspec-rails', '~> 3.6.0'
316316
gem 'rspec-retry', '~> 0.4.5'
317317
gem 'spinach-rails', '~> 0.2.1'

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ GEM
195195
excon (0.57.1)
196196
execjs (2.6.0)
197197
expression_parser (0.9.0)
198-
factory_girl (4.7.0)
198+
factory_bot (4.8.2)
199199
activesupport (>= 3.0.0)
200-
factory_girl_rails (4.7.0)
201-
factory_girl (~> 4.7.0)
200+
factory_bot_rails (4.8.2)
201+
factory_bot (~> 4.8.2)
202202
railties (>= 3.0.0)
203203
faraday (0.12.2)
204204
multipart-post (>= 1.2, < 3)
@@ -1020,7 +1020,7 @@ DEPENDENCIES
10201020
dropzonejs-rails (~> 0.7.1)
10211021
email_reply_trimmer (~> 0.1)
10221022
email_spec (~> 1.6.0)
1023-
factory_girl_rails (~> 4.7.0)
1023+
factory_bot_rails (~> 4.8.2)
10241024
faraday (~> 0.12)
10251025
ffaker (~> 2.4)
10261026
flay (~> 2.8.0)

app/controllers/projects/notes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Projects::NotesController < Projects::ApplicationController
1111
# Controller actions are returned from AbstractController::Base and methods of parent classes are
1212
# excluded in order to return only specific controller related methods.
1313
# That is ok for the app (no :create method in ancestors)
14-
# but fails for tests because there is a :create method on FactoryGirl (one of the ancestors)
14+
# but fails for tests because there is a :create method on FactoryBot (one of the ancestors)
1515
#
1616
# see https://github.com/rails/rails/blob/v4.2.7/actionpack/lib/abstract_controller/base.rb#L78
1717
#

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Application < Rails::Application
163163
config.middleware.insert_after ActionDispatch::Flash, 'Gitlab::Middleware::ReadOnly'
164164

165165
config.generators do |g|
166-
g.factory_girl false
166+
g.factory_bot false
167167
end
168168

169169
config.after_initialize do

db/fixtures/development/17_cycle_analytics.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ def add_milestones_and_list_labels(issues)
140140
issue.update(milestone: @project.milestones.sample)
141141
else
142142
label_name = "#{FFaker::Product.brand}-#{FFaker::Product.brand}-#{rand(1000)}"
143-
list_label = FactoryGirl.create(:label, title: label_name, project: issue.project)
144-
FactoryGirl.create(:list, board: FactoryGirl.create(:board, project: issue.project), label: list_label)
143+
list_label = FactoryBot.create(:label, title: label_name, project: issue.project)
144+
FactoryBot.create(:list, board: FactoryBot.create(:board, project: issue.project), label: list_label)
145145
issue.update(labels: [list_label])
146146
end
147147

doc/development/gotchas.md

Lines changed: 2 additions & 2 deletions

doc/development/testing_guide/best_practices.md

Lines changed: 7 additions & 7 deletions

doc/development/testing_guide/index.md

Lines changed: 1 addition & 1 deletion

features/support/env.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# web editor and merge
2828
TestEnv.disable_pre_receive
2929

30-
include FactoryGirl::Syntax::Methods
30+
include FactoryBot::Syntax::Methods
3131
include GitlabRoutingHelper
3232
end
3333

spec/factories/abuse_reports.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FactoryGirl.define do
1+
FactoryBot.define do
22
factory :abuse_report do
33
reporter factory: :user
44
user

0 commit comments

Comments
 (0)