Skip to content

Commit

Permalink
Upgrade to factory_bot
Browse files Browse the repository at this point in the history
  • Loading branch information
rcristal committed Nov 14, 2017
1 parent d1057b3 commit 1135faa
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Expand Up @@ -57,8 +57,8 @@ end
group :test do
gem 'capybara'
gem 'deep_merge' # recursively merge hashes
gem 'factory_girl'
gem 'factory_girl_rails'
gem 'factory_bot'
gem 'factory_bot_rails'
gem 'launchy' # provides `save_and_open_page`
gem 'rb-fsevent'
end
10 changes: 5 additions & 5 deletions Gemfile.lock
Expand Up @@ -82,10 +82,10 @@ GEM
activesupport (>= 4.0, < 6)
excon (0.59.0)
execjs (2.7.0)
factory_girl (4.9.0)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
factory_girl_rails (4.9.0)
factory_girl (~> 4.9.0)
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
ffi (1.9.18)
fog-aws (1.4.1)
Expand Down Expand Up @@ -301,8 +301,8 @@ DEPENDENCIES
devise
dotenv-rails
exception_notification
factory_girl
factory_girl_rails
factory_bot
factory_bot_rails
fog-aws
haml
haml-rails
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/activities.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :activity do
name "eating lasagna"
price 9900
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/attendees.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do

factory :attendee do
birth_date "1981-09-10"
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/contacts.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :contact do
title "Registrar"
given_name "Jane"
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/plans.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :event do
sequence(:name) { |n| "Event #{n}" }
year Time.now.year
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/shirts.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :shirt do
name 'Unicorn vs. Werewolf'
description 'Nam ac tortor lorem, vel egestas lorem.'
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/tournaments.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :tournament do
sequence(:name) { |n| "Tournament #{n}"}
eligible "blah"
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/transactions.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do

# The `:base_transaction` represents the attributes
# common to all other factories. It does not have enough
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/users.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do

sequence(:random_email) {|n| "test#{n}@example.com" }

Expand Down
2 changes: 1 addition & 1 deletion spec/factories/years.rb
@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :year do
year Date.current.year
city 'Black Mountain'
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Expand Up @@ -13,7 +13,7 @@
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
config.include Devise::Test::ControllerHelpers, type: :controller
config.include FactoryGirl::Syntax::Methods
config.include FactoryBot::Syntax::Methods
end

# TODO: use rspec helper method instead of global method
Expand Down

0 comments on commit 1135faa

Please sign in to comment.