@@ -36,10 +36,10 @@ Feature: Directory Structure
36
36
`RSpec.describe` block with the `type: :controller` metadata:
37
37
38
38
```ruby
39
- # spec/legacy/things_controller_spec.rb
39
+ # spec/legacy/things_controller_spec.rb
40
40
RSpec.describe ThingsController, type: :controller do
41
41
describe "GET index" do
42
- # Examples
42
+ # Examples
43
43
end
44
44
end
45
45
```
@@ -59,7 +59,7 @@ Feature: Directory Structure
59
59
In RSpec 3, this behavior must be explicitly enabled:
60
60
61
61
```ruby
62
- # spec/rails_helper.rb
62
+ # spec/rails_helper.rb
63
63
RSpec.configure do |config|
64
64
config.infer_spec_type_from_file_location!
65
65
end
@@ -75,7 +75,7 @@ Feature: Directory Structure
75
75
If you want to set metadata for a custom directory that doesn't follow fit the canonical structure above, you can do the following:
76
76
77
77
```ruby
78
- # set `:type` for serializers directory
78
+ # set `:type` for serializers directory
79
79
RSpec.configure do |config|
80
80
config.define_derived_metadata(:file_path => Regexp.new('/spec/serializers/' )) do |metadata|
81
81
metadata[:type] = :serializer
@@ -101,37 +101,37 @@ Feature: Directory Structure
101
101
│ └── books_helper.rb
102
102
├── models
103
103
│ ├── author.rb
104
- │ ├ ── book.rb
104
+ │ └ ── book.rb
105
105
└── views
106
106
├── books
107
- ├ ── layouts
107
+ └ ── layouts
108
108
lib
109
109
├── country_map.rb
110
110
├── development_mail_interceptor.rb
111
111
├── enviroment_mail_interceptor.rb
112
112
└── tasks
113
- ├ ── irc.rake
113
+ └ ── irc.rake
114
114
spec
115
115
├── controllers
116
- │ ├ ── books_controller_spec.rb
116
+ │ └ ── books_controller_spec.rb
117
117
├── country_map_spec.rb
118
118
├── features
119
- │ ├ ── tracking_book_delivery_spec.rb
119
+ │ └ ── tracking_book_delivery_spec.rb
120
120
├── helpers
121
121
│ └── books_helper_spec.rb
122
122
├── models
123
123
│ ├── author_spec.rb
124
- │ ├ ── book_spec.rb
124
+ │ └ ── book_spec.rb
125
125
├── rails_helper.rb
126
126
├── requests
127
- │ ├ ── books_spec.rb
127
+ │ └ ── books_spec.rb
128
128
├── routing
129
129
│ └── books_routing_spec.rb
130
130
├── spec_helper.rb
131
- └ ── tasks
132
- │ ├ ── irc_spec.rb
131
+ ├ ── tasks
132
+ │ └ ── irc_spec.rb
133
133
└── views
134
- ├ ── books
134
+ └ ── books
135
135
136
136
Scenario : Standard Rails specs must specify the `:type` metadata
137
137
Given a file named "spec/functional/widgets_controller_spec.rb" with:
0 commit comments