Sha256: 4b6b918187bcc7d21f57ca01b52d24f7189bb80fb5deb5e2ac60c552c907c735
Contents?: true
Size: 682 Bytes
Versions: 10
Compression:
Stored size: 682 Bytes
Contents
require "spec_helper" describe Rack::API, "Params" do before do Rack::API.app do version :v1 do get("users/:id(.:format)") { params } post("users") { params } end end end it "detects optional names from routing params" do get "/v1/users/1.json" json(last_response.body).should == {"id" => "1", "format" => "json"} end it "detects query string params" do get "/v1/users/1?include=articles" json(last_response.body).should == {"id" => "1", "include" => "articles"} end it "detects post params" do post "/v1/users", :name => "John Doe" last_response.body.should == {"name" => "John Doe"}.to_json end end
Version data entries
10 entries across 10 versions & 1 rubygems