mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
add support for rubocop-rspec syntax extensions
This commit is contained in:
parent
56af8f3ce2
commit
6279549cdb
2 changed files with 15 additions and 0 deletions
10
README.md
10
README.md
|
@ -802,6 +802,16 @@ An alternative approach to Pundit policy specs is scoping them to a user context
|
|||
|
||||
Pundit does not provide a DSL for testing scopes. Just test it like a regular Ruby class!
|
||||
|
||||
### Linting with RuboCop RSpec
|
||||
|
||||
When you lint your RSpec spec files with `rubocop-rspec`, it will fail to properly detect RSpec constructs that Pundit defines, `permissions`.
|
||||
Make sure to use `rubocop-rspec` 2.0 or newer and add the following to your `.rubocop.yml`:
|
||||
|
||||
```yaml
|
||||
inherit_gem:
|
||||
pundit: config/rubocop-rspec.yml
|
||||
```
|
||||
|
||||
# External Resources
|
||||
|
||||
- [RailsApps Example Application: Pundit and Devise](https://github.com/RailsApps/rails-devise-pundit)
|
||||
|
|
5
config/rubocop-rspec.yml
Normal file
5
config/rubocop-rspec.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
RSpec:
|
||||
Language:
|
||||
ExampleGroups:
|
||||
Regular:
|
||||
- permissions
|
Loading…
Reference in a new issue