improve test setup

This commit is contained in:
João Victor Geonizeli
2022-02-27 14:23:37 -03:00
parent ee07cac9b2
commit cec57e0ad2
3 changed files with 20 additions and 38 deletions

41
Gemfile
View File

@@ -2,49 +2,16 @@ source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" } git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.1.1" ruby "3.1.1"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.2", ">= 7.0.2.2" gem "rails", "~> 7.0.2", ">= 7.0.2.2"
# Use postgresql as the database for Active Record
gem "pg", "~> 1.1" gem "pg", "~> 1.1"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0" gem "puma", "~> 5.0"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem "rack-cors"
group :development, :test do group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ] gem "debug", platforms: %i[ mri mingw x64_mingw ]
gem "rspec-rails", "~> 5.1"
gem "factory_bot_rails", "~> 6.2"
gem "shoulda-matchers", "~> 5.1"
end end
group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
gem "rspec-rails", "~> 5.1"

View File

@@ -77,6 +77,11 @@ GEM
diff-lcs (1.5.0) diff-lcs (1.5.0)
digest (3.1.0) digest (3.1.0)
erubi (1.10.0) 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)
globalid (1.0.0) globalid (1.0.0)
activesupport (>= 5.0) activesupport (>= 5.0)
i18n (1.10.0) i18n (1.10.0)
@@ -166,6 +171,8 @@ GEM
rspec-mocks (~> 3.10) rspec-mocks (~> 3.10)
rspec-support (~> 3.10) rspec-support (~> 3.10)
rspec-support (3.11.0) rspec-support (3.11.0)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
strscan (3.0.1) strscan (3.0.1)
thor (1.2.1) thor (1.2.1)
timeout (0.2.0) timeout (0.2.0)
@@ -182,11 +189,12 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
bootsnap bootsnap
debug debug
factory_bot_rails (~> 6.2)
pg (~> 1.1) pg (~> 1.1)
puma (~> 5.0) puma (~> 5.0)
rails (~> 7.0.2, >= 7.0.2.2) rails (~> 7.0.2, >= 7.0.2.2)
rspec-rails (~> 5.1) rspec-rails (~> 5.1)
tzinfo-data shoulda-matchers (~> 5.1)
RUBY VERSION RUBY VERSION
ruby 3.1.1p18 ruby 3.1.1p18

View File

@@ -62,3 +62,10 @@ RSpec.configure do |config|
# arbitrary gems may also be filtered via: # arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name") # config.filter_gems_from_backtrace("gem name")
end end
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end