Browse Source

Add factorybot

pull/21/head
baarkerlounger 3 years ago
parent
commit
0c73220831
  1. 1
      Gemfile
  2. 6
      Gemfile.lock
  3. 8
      spec/spec_helper.rb

1
Gemfile

@ -28,6 +28,7 @@ group :development, :test do
gem "pry-byebug"
gem "dotenv-rails"
gem "selenium-webdriver"
gem "factory_bot_rails"
%w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: "main"
end

6
Gemfile.lock

@ -134,6 +134,11 @@ GEM
dotenv (= 2.7.6)
railties (>= 3.2)
erubi (1.10.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
ffi (1.15.4)
globalid (0.5.2)
activesupport (>= 5.0)
@ -311,6 +316,7 @@ DEPENDENCIES
byebug
capybara
dotenv-rails
factory_bot_rails
govuk-components
govuk_design_system_formbuilder
jbuilder (~> 2.7)

8
spec/spec_helper.rb

@ -13,6 +13,9 @@
# it.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require "factory_bot"
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
@ -84,11 +87,14 @@ RSpec.configure do |config|
# # order dependency and want to debug it, you can fix the order by providing
# # the seed, which is printed after each run.
# # --seed 1234
# config.order = :random
config.order = :random
#
# # Seed global randomization in this process using the `--seed` CLI option.
# # Setting this allows you to use `--seed` to deterministically reproduce
# # test failures related to randomization by passing the same `--seed` value
# # as the one that triggered the failure.
# Kernel.srand config.seed
config.include FactoryBot::Syntax::Methods
end

Loading…
Cancel
Save