josephruscio / rack-test-rest Goto Github PK
View Code? Open in Web Editor NEWExtends `rack-test` with support for _CRUD_ operations.
License: MIT License
Extends `rack-test` with support for _CRUD_ operations.
License: MIT License
Support the short hand read_resource(val)
by assuming val
(if not a hash) is the resource ID. This would be equivalent to read_resource(:id => val)
. Seems like that is a common case.
Example:
NoMethodError: undefined method `pretty_inspect' for {}:Hash
/Users/jruscio/.rvm/gems/ree-1.8.7-2011.03@librato/gems/rack-test-rest-0.4.3/lib/rack-test-rest.rb:63:in `read_resource'
test/../test/../test/../test/../test/../test/../test/../test/../test/../test/../test/../test/../test/annotation_test.rb:39:in `test_get_annotation'
It would be handy to DRY out tests by using the root_uri as a prefix in the :location check to create_resource. Maybe if the @rack_test_rest[:location]
did not start with a forward slash then the root_uri
could be prefixed to the :location regexp before testing a match?
something like:
def assert_valid_json(response, msg = nil)
full_message = build_message(msg, "response should be valid JSON")
assert_block(full_message) do
parsable = begin
JSON.parse last_response.body
true
rescue JSON::ParserError
false
end
parsable && last_response.header['Content-Type'].include?("application/json")
end
end
Right now calls require symbols, it would be nice if we did indifferent access internally so users didn't have to cast all keys to symbols before use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.