Sha256: 71398adcb65bc0560261cb7b7c9f3a00a64702fee2005112a0f20d49a2a48218

Contents?: true

Size: 925 Bytes

Versions: 16

Compression:

Stored size: 925 Bytes

Contents

<%- unless omit_comments? -%>
# Register a payload to validate against.
# Add expected attributes within this block, e.g.:
#
# key(:name)
#
# Optionally validate the type as well:
#
# key(:name, String)
#
# This will:
#
# * Compare record.name == json['name']
# * Ensure no extra keys are in the json payload
# * Ensure no values are nil (unless allow_nil: true is passed)
# * Ensures json['name'] is a string
#
# If you have custom serialization logic and want to compare against
# something other than "record.name", pass a block:
#
# key(:name) { |record| record.name.upcase }
#
# Or, if this is a one-off for a particular spec, do that customization at
# runtime:
#
# assert_payload(:person, person_record, json_item) do
#   key(:name) { 'Homer Simpson' }
# end
#
# For more information, see https://jsonapi-suite.github.io/jsonapi_spec_helpers/
<%- end -%>
JsonapiSpecHelpers::Payload.register(:<%= file_name %>) do
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
jsonapi_compliable-0.10.3 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.10.2 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.10.1 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.10.0 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.9.2 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.9.1 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.9.0 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.8.0 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.9 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.8 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.7 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.6 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.5 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.4 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.3 lib/generators/jsonapi/templates/payload.rb.erb
jsonapi_compliable-0.7.2 lib/generators/jsonapi/templates/payload.rb.erb