File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
lib/action_kit_rest/response Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class InvalidAkidError < ValidationError
27
27
'לא הצלחנו לקשר בין מספר הזיהוי של רשימת הדיוור הזו לבין החשבון.' ] . freeze
28
28
29
29
def self . matches? ( errors )
30
- return false unless errors . keys == [ 'mailing_id' ]
30
+ return false unless errors & .keys == [ 'mailing_id' ]
31
31
32
32
mailing_id_errors = errors [ 'mailing_id' ]
33
33
return false unless mailing_id_errors . size == 1
Original file line number Diff line number Diff line change 52
52
expect { subject . post_request ( 'something/' , request_body ) } . to raise_error ( ActionKitRest ::Response ::ValidationError )
53
53
end
54
54
end
55
+
56
+ context 'no errors key in response' do
57
+ let ( :response_body ) { '{"strange": "things are happening here"}' }
58
+
59
+ it 'sould raise a ValidationError' do
60
+ expect { subject . post_request ( 'something/' , request_body ) } . to raise_error ( ActionKitRest ::Response ::ValidationError )
61
+ end
62
+ end
55
63
end
56
64
57
65
context '401 response' do
You can’t perform that action at this time.
0 commit comments