Skip to content

Commit bd653c5

Browse files
committed
update rspec-rails and re-run generator
1 parent 02de7c9 commit bd653c5

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ GEM
435435
rspec-mocks (3.13.1)
436436
diff-lcs (>= 1.2.0, < 2.0)
437437
rspec-support (~> 3.13.0)
438-
rspec-rails (7.0.1)
438+
rspec-rails (7.1.0)
439439
actionpack (>= 7.0)
440440
activesupport (>= 7.0)
441441
railties (>= 7.0)
@@ -672,4 +672,4 @@ RUBY VERSION
672672
ruby 3.2.4p170
673673

674674
BUNDLED WITH
675-
2.5.22
675+
2.5.23

spec/rails_helper.rb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# directory. Alternatively, in the individual `*_spec.rb` files, manually
3333
# require only the support files necessary.
3434
#
35-
Rails.root.glob("spec/support/**/*.rb").sort.each { |f| require f }
35+
Rails.root.glob("spec/support/**/*.rb").sort_by(&:to_s).each { |f| require f }
3636

3737
# Checks for pending migrations and applies them before tests are run.
3838
# If you are not using ActiveRecord, you can remove these lines.
@@ -76,19 +76,21 @@
7676
# You can uncomment this line to turn off ActiveRecord support entirely.
7777
# config.use_active_record = false
7878

79-
# RSpec Rails can automatically mix in different behaviours to your tests
80-
# based on their file location, for example enabling you to call `get` and
81-
# `post` in specs under `spec/controllers`.
79+
# RSpec Rails uses metadata to mix in different behaviours to your tests,
80+
# for example enabling you to call `get` and `post` in request specs. e.g.:
8281
#
83-
# You can disable this behaviour by removing the line below, and instead
84-
# explicitly tag your specs with their type, e.g.:
85-
#
86-
# RSpec.describe UsersController, type: :controller do
82+
# RSpec.describe UsersController, type: :request do
8783
# # ...
8884
# end
8985
#
9086
# The different available types are documented in the features, such as in
9187
# https://rspec.info/features/7-0/rspec-rails
88+
#
89+
# You can also this infer these behaviours automatically by location, e.g.
90+
# /spec/models would pull in the same behaviour as `type: :model` but this
91+
# behaviour is considered legacy and will be removed in a future version.
92+
#
93+
# To enable this behaviour uncomment the line below.
9294
config.infer_spec_type_from_file_location!
9395
# Auto detect datatable type specs
9496
config.define_derived_metadata(file_path: Regexp.new("/spec/datatables/")) do |metadata|
@@ -100,11 +102,10 @@
100102
metadata[:aggregate_failures] = true unless non_aggregate_types.include?(metadata[:type])
101103
end
102104

103-
config.example_status_persistence_file_path = Rails.root.join("tmp/persistent_examples.txt")
104-
105-
# Filter backtraces to gems that are not under our control.
106-
# Can override using `--backtrace` option to rspec to see full backtraces.
105+
# Filter lines from Rails gems in backtraces.
106+
# Use `rspec --backtrace` option to see full backtraces.
107107
config.filter_rails_from_backtrace!
108+
# arbitrary gems may also be filtered via:
108109
config.filter_gems_from_backtrace(*%w[
109110
bootsnap capybara factory_bot puma rack railties shoulda-matchers
110111
sprockets-rails pundit

spec/spec_helper.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@
7878
# aliases for `it`, `describe`, and `context` that include `:focus`
7979
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
8080
config.filter_run_when_matching :focus
81-
#
81+
8282
# Allows RSpec to persist some state between runs in order to support
8383
# the `--only-failures` and `--next-failure` CLI options. We recommend
8484
# you configure your source control system to ignore this file.
8585
config.example_status_persistence_file_path = "tmp/persistent_examples.txt"
86-
#
86+
8787
# Limits the available syntax to the non-monkey patched syntax that is
8888
# recommended. For more details, see:
8989
# https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
9090
config.disable_monkey_patching!
91-
#
91+
9292
# Many RSpec users commonly either run the entire suite or an individual
9393
# file, and it's useful to allow more verbose output when running an
9494
# individual spec file.
@@ -98,18 +98,18 @@
9898
# (e.g. via a command-line flag).
9999
config.default_formatter = "doc"
100100
end
101-
#
102-
# # Print the 10 slowest examples and example groups at the
103-
# # end of the spec run, to help surface which specs are running
104-
# # particularly slow.
105-
# config.profile_examples = 10
106-
#
101+
102+
# Print the 10 slowest examples and example groups at the
103+
# end of the spec run, to help surface which specs are running
104+
# particularly slow.
105+
# config.profile_examples = 10
106+
107107
# Run specs in random order to surface order dependencies. If you find an
108108
# order dependency and want to debug it, you can fix the order by providing
109109
# the seed, which is printed after each run.
110110
# --seed 1234
111111
config.order = :random
112-
#
112+
113113
# Seed global randomization in this process using the `--seed` CLI option.
114114
# Setting this allows you to use `--seed` to deterministically reproduce
115115
# test failures related to randomization by passing the same `--seed` value

0 commit comments

Comments
 (0)