Add spec for unescaped special characters

This commit is contained in:
Garret Alfert 2014-02-24 20:44:23 +01:00
parent 9e6cc6178d
commit a6707dd40d

View File

@ -473,6 +473,25 @@ describe "App with Riak backend" do
end end
end end
context "with unescaped key" do
before do
put "/jimmy/documents/bar:baz/john@doe.com", "John Doe"
end
it "lists the document in the directory" do
get "/jimmy/documents/bar:baz/"
content = JSON.parse(last_response.body)
content.must_include "john@doe.com"
end
it "delivers the data correctly" do
get "/jimmy/documents/bar:baz/john@doe.com"
last_response.body.must_equal "John Doe"
end
end
context "escaped square brackets in key" do context "escaped square brackets in key" do
before do before do
put "/jimmy/documents/gracehopper%5B1%5D.jpg", "super image" put "/jimmy/documents/gracehopper%5B1%5D.jpg", "super image"