Merge branch 'master' into rs_spec_02

Conflicts:
	lib/remote_storage/riak.rb
	spec/directories_spec.rb
This commit is contained in:
Garret Alfert
2014-09-23 17:58:21 +02:00
6 changed files with 59 additions and 25 deletions

View File

@@ -543,17 +543,36 @@ describe "App with Riak backend" do
context "with escaped key" do
before do
put "/jimmy/documents/http%3A%2F%2F5apps.com", "super website"
put "/jimmy/documents/bar%3Abaz/http%3A%2F%2F5apps.com", "super website"
end
it "delivers the data correctly" do
header "Authorization", "Bearer 123"
get "/jimmy/documents/http%3A%2F%2F5apps.com"
get "/jimmy/documents/bar%3Abaz/http%3A%2F%2F5apps.com"
last_response.body.must_equal 'super website'
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["items"]["john@doe.com"].wont_be_nil
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
before do
put "/jimmy/documents/gracehopper%5B1%5D.jpg", "super image"