Make RSpec infer the file type from its location

Apparently, although we tend to add the type of spec file some RSpec
methods are not working without it. We're getting:

```
NoMethodError:
  undefined method `helper' for RSpec::ExampleGroups::SpreeSharedOrderDetailsHtmlHaml:Class
```

```
NameError:
   undefined local variable or method `controller' for #<RSpec::ExampleGroups::SpreeAdminUsersController::AuthorizeAdmin:0x00007fa8b32addf8>
 # ./spec/controllers/spree/admin/users_controller_spec.rb:10:in `block (3 levels) in <top (required)>'
```

It needs more investigation but another day.
This commit is contained in:
Pau Perez
2020-08-04 11:24:49 +02:00
parent 9ef59f440b
commit 6e39ab779c

View File

@@ -201,4 +201,5 @@ RSpec.configure do |config|
# config.after :suite do
# PerfTools::CpuProfiler.stop
# end
config.infer_spec_type_from_file_location!
end