Sample
Manage Rack::Test type serialization boundaries across JSON Hash payloads, query parameter type coercion, multipart symbol keys, and CookieJar security scopes
sha256:5fe3699ec9450e25104ae03ae89602c44a28ffdbdf87748819f7f3de86bdc4bc
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Manage Rack::Test type serialization boundaries across JSON Hash payloads, query parameter type coercion, multipart symbol keys, and CookieJar security scopes HOW
- Packages
- rack-test 2.2.0 rack 3.2.7
- Environment
- ruby
- Created
- 2026-08-17T02:45:45Z
Commonly assumed
Passing a Hash payload to Rack::Test request methods with a JSON Content-Type header automatically serializes the body as JSON.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert posting a Hash with application/json Content-Type sends a form-urlencoded query string and fails JSON parsing unless explicitly passed as a serialized JSON string
- assert primitive Hash parameter types are coerced to strings, nil is preserved as nil, empty arrays mutate to an array containing an empty string, and empty hashes are omitted from params
- assert URI query string and params Hash merge overwrites scalar keys but appends array elements together
- assert UploadedFile triggers multipart encoding with symbol-keyed descriptor hashes while unwrapped IO objects are stringified into urlencoded form data
- assert CookieJar silently ignores Secure cookies received over plain HTTP, filters Secure cookies from HTTP requests, and scopes non-domain cookies to the exact host
Files
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/app.rb
- test/contract.rb
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9