@@ -43,10 +43,10 @@ Feature: The directory structure
43
43
`RSpec.describe` block with the `type: :controller` metadata:
44
44
45
45
```ruby
46
- # spec/legacy/things_controller_spec.rb
46
+ # spec/legacy/things_controller_spec.rb
47
47
RSpec.describe ThingsController, type: :controller do
48
48
describe "GET index" do
49
- # Examples
49
+ # Examples
50
50
end
51
51
end
52
52
```
@@ -56,7 +56,7 @@ Feature: The directory structure
56
56
57
57
Check out the [`rspec-core`](../../latest/rspec-core) documentation on [using metadata](../../latest/rspec-core/metadata) for more details.
58
58
59
- ## Automatically Adding Metadata
59
+ ** Automatically Adding Metadata**
60
60
61
61
RSpec versions before 3.0.0 automatically added metadata to specs based on
62
62
their location on the filesystem. This was both confusing to new users and not
@@ -65,7 +65,7 @@ Feature: The directory structure
65
65
This behaviour must be explicitly enabled:
66
66
67
67
```ruby
68
- # spec/rails_helper.rb
68
+ # spec/rails_helper.rb
69
69
RSpec.configure do |config|
70
70
config.infer_spec_type_from_file_location!
71
71
end
@@ -81,15 +81,15 @@ Feature: The directory structure
81
81
If you want to set metadata for a custom directory that doesn't follow fit the canonical structure above, you can do the following:
82
82
83
83
```ruby
84
- # set `:type` for serializers directory
84
+ # set `:type` for serializers directory
85
85
RSpec.configure do |config|
86
86
config.define_derived_metadata(:file_path => Regexp.new('/spec/serializers/' )) do |metadata|
87
87
metadata[:type] = :serializer
88
88
end
89
89
end
90
90
```
91
91
92
- ## Tips on Spec Location
92
+ ** Tips on Spec Location**
93
93
94
94
It is suggested that the `spec/` directory structure generally mirror both
95
95
`app/` and `lib/`. This makes it easy to locate corresponding code and spec
0 commit comments