|
32 | 32 | # directory. Alternatively, in the individual `*_spec.rb` files, manually |
33 | 33 | # require only the support files necessary. |
34 | 34 | # |
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 } |
36 | 36 |
|
37 | 37 | # Checks for pending migrations and applies them before tests are run. |
38 | 38 | # If you are not using ActiveRecord, you can remove these lines. |
|
76 | 76 | # You can uncomment this line to turn off ActiveRecord support entirely. |
77 | 77 | # config.use_active_record = false |
78 | 78 |
|
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.: |
82 | 81 | # |
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 |
87 | 83 | # # ... |
88 | 84 | # end |
89 | 85 | # |
90 | 86 | # The different available types are documented in the features, such as in |
91 | 87 | # 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. |
92 | 94 | config.infer_spec_type_from_file_location! |
93 | 95 | # Auto detect datatable type specs |
94 | 96 | config.define_derived_metadata(file_path: Regexp.new("/spec/datatables/")) do |metadata| |
|
100 | 102 | metadata[:aggregate_failures] = true unless non_aggregate_types.include?(metadata[:type]) |
101 | 103 | end |
102 | 104 |
|
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. |
107 | 107 | config.filter_rails_from_backtrace! |
| 108 | + # arbitrary gems may also be filtered via: |
108 | 109 | config.filter_gems_from_backtrace(*%w[ |
109 | 110 | bootsnap capybara factory_bot puma rack railties shoulda-matchers |
110 | 111 | sprockets-rails pundit |
|
0 commit comments