test/api_test.rb
# This middleware has the CRUD interface for
# managing documents through a JSON-based API
#
# The API needs the Document class to implement these methods:
# - Class.admin_get
#   - Needs to be able to accept the ID as a string
#   - The class is responsible for conversion
#   - So a mix of different classes of IDs is not possible
# - instance.to_h
# - instance.save
# - instance.delete
This middleware has the CRUD interface for
managing documents through a JSON-based API

The API needs the Document class to implement these methods:
Class.admin_get
Needs to be able to accept the ID as a string
The class is responsible for conversion
So a mix of different classes of IDs is not possible
instance.to_h
instance.save
instance.delete
This middleware has the CRUD interface for managing documents through a JSON - based API The API needs the Document class to implement these methods : Class . admin_get Needs to be able to accept the ID as a string The class is responsible for conversion So a mix of different classes of IDs is not possible instance . to_h instance . save instance . delete
def successful_sorting(res)
    json = JSON.parse(res.body)
    res.content_type.should=='application/json'
    res.status.should==200
    json['success'].should==true
    json['message'].should=='Sorted Successfully'
    json
  end
def successful_sorting ( res ) json = JSON . parse ( res . body ) res . content_type . should == 'application/json' res . status . should == 200 json [ 'success' ] . should == true json [ 'message' ] . should == 'Sorted Successfully' json end
This middleware has the CRUD interface for
managing documents through a JSON-based API
This middleware has the CRUD interface for managing documents through a JSON - based API
res
<not_specific>