Use roar representers with respond_with in a way that you can easily use multiple representers for the same model and for the same controller but without being mandatory.
Test 'representer_class' for the controller at an class level (define representer_class for the class)
'respond_with' for a successful 'GET' request of an entity (Active Record) #21
'respond_with' for a successful 'GET' request of a collection (ActiveRecord::Relation) #21
'respond_with' for a successful 'POST' request of an entity (Active Record) #21
'respond_with' for a failed 'POST' request of an entity (Active Record) #21
'respond_with' for a successful 'GET' request of an entity (Mongo ID) #21
'respond_with' for a successful 'GET' request of a collection (Mongoid::Criteria) #21
'respond_with' for a successful 'POST' request of an entity (Mongo ID) #21
'respond_with' for a failed 'POST' request of an entity (Mongo ID) #21
'respond_with' for a successful 'GET' request of an entity (PORO) #21
'respond_with' for a successful 'GET' request of a collection (Array of PORO) #21
'respond_with' for a successful 'POST' request of an entity (PORO) #21
'respond_with' for a failed 'POST' request of an entity (PORO) #21
โ ๏ธ Ensure that it is not inferring the value but actual fetching it from the direct manual definition inside the controller
Test 'representer_class' for the controller being inferred for the model
'respond_with' for a successful 'GET' request of an entity (Active Record) #27
'respond_with' for a successful 'GET' request of a collection (ActiveRecord::Relation) #27
'respond_with' for a successful 'POST' request of an entity (Active Record) #27
'respond_with' for a failed 'POST' request of an entity (Active Record) #27
'respond_with' for a successful 'GET' request of an entity (Mongo ID) #27
'respond_with' for a successful 'GET' request of a collection (Mongoid::Criteria) #27
'respond_with' for a successful 'POST' request of an entity (Mongo ID) #27
'respond_with' for a failed 'POST' request of an entity (Mongo ID) #27
'respond_with' for a successful 'GET' request of an entity (PORO) #23
'respond_with' for a successful 'GET' request of a collection (A Ruby object that acts as a collection of DummyPoro and that responds to 'length' and other enumerable methods perhaps... because a bare Array wouldn't respond to model_name which is necessary here) #26
'respond_with' for a successful 'POST' request of an entity (PORO) #24
'respond_with' for a failed 'POST' request of an entity (PORO) #25
Test render a model to JSON with default serializer
Test default model.to_json when the inferred representer class does not exist. The resource of this test also does not need to respond to model_name, but apparently, it needs to respond to to_model although that it's not for this gem itself but for one of the dependencies. #29