module ActiveModel::Serializer::Lint::Tests

def test_to_json

Typically, it is implemented on all objects when the JSON gem is required.
It may be called on the result of as_json.
to_json returns a string representation (JSON) of a serialized object.

Fails otherwise.
zero or one arguments.
Passes if the object responds to to_json and if it takes
def test_to_json
  assert_respond_to resource, :to_json
  resource.to_json
  resource.to_json(nil)
end