Class: JsonapiSpec::Matchers::HaveJsonapiError
- Inherits:
-
Object
- Object
- JsonapiSpec::Matchers::HaveJsonapiError
- Includes:
- Helpers
- Defined in:
- lib/jsonapi_spec/matchers/have_jsonapi_error.rb
Instance Method Summary collapse
Methods included from Helpers
Instance Method Details
#failure_message ⇒ Object
14 15 16 |
# File 'lib/jsonapi_spec/matchers/have_jsonapi_error.rb', line 14 def "Not a valid jsonapi error #{@validate_error_message}" end |
#failure_message_when_negated ⇒ Object
18 19 20 |
# File 'lib/jsonapi_spec/matchers/have_jsonapi_error.rb', line 18 def "Valid jsonapi error" end |
#matches?(json) ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/jsonapi_spec/matchers/have_jsonapi_error.rb', line 6 def matches?(json) document = parse_jsonapi(json) document.key?('errors') rescue JSONAPI::Parser::InvalidDocument => ex = ex. false end |