ezcater_rubocop 0.49.7.rc1 → 0.49.7.rc2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adc30cfbd7e6cb6961f4ea27bf00b5725666dad009d4591ba346a4c42bcf7ee8
|
4
|
+
data.tar.gz: e92922914ccd70fe77c44015373fe7041b9548228d611dfbdd2c8f5639ea20db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87ae3797cd9dc446c61acb36bc01bec66484db4dbc3e6737e53faa3cd73f9b37dbf8e9ec9f2f2cce3b4cd42a1a0c1239502d78e60266f2746f977f39a1666fc9
|
7
|
+
data.tar.gz: c0ad2fd84ce5d609ca40a59d8d9cd69fa9201b994bf8d373e2638b4b61d8fd7113fc7ea4c1569e287d1d4205ff12528e8987e649892a5e420b33b763d3dfb998
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# ezcater_rubocop
|
2
2
|
|
3
3
|
## v0.49.7
|
4
|
-
-
|
5
|
-
- Enable `Rails/HttpStatus` cop and enforce symbols.
|
4
|
+
- Fix `Ezcater/RspecRequireHttpStatusMatcher` cop.
|
6
5
|
|
7
6
|
## v0.49.6
|
8
7
|
- Rename `Ezcater/RspecRequireGqlErrorHelpers` cop to `Ezcater/RequireGqlErrorHelpers`.
|
@@ -18,12 +18,16 @@ module RuboCop
|
|
18
18
|
MSG = "Use the `have_http_status` matcher, like `expect(response).to have_http_status :bad_request`, "\
|
19
19
|
"rather than `%<node_source>s`"
|
20
20
|
|
21
|
+
def_node_matcher :response_status_assertion, <<~PATTERN
|
22
|
+
(send (send _ :expect (send (send _ :response) :status)) :to (send _ :eq (int _)))
|
23
|
+
PATTERN
|
24
|
+
|
21
25
|
def_node_matcher :response_code_assertion, <<~PATTERN
|
22
|
-
(send (send _ :expect (send (send _ :response) :code)) :to (send _ :eq (
|
26
|
+
(send (send _ :expect (send (send _ :response) :code)) :to (send _ :eq (str _)))
|
23
27
|
PATTERN
|
24
28
|
|
25
29
|
def on_send(node)
|
26
|
-
return
|
30
|
+
return if !response_status_assertion(node) && !response_code_assertion(node)
|
27
31
|
|
28
32
|
add_offense(node,
|
29
33
|
location: :expression,
|