Create directory objects for parent directories that don't contain any files themselves

This commit is contained in:
2012-09-26 19:58:43 +02:00
parent 4d01144bf4
commit 9250bb7790
2 changed files with 36 additions and 0 deletions

View File

@@ -65,6 +65,29 @@ describe "Directories" do
content["home/"].to_s.must_match /\d+/
content["home/"].to_s.length.must_be :>=, 10
end
context "sub-directories without objects" do
it "lists the direct sub-directories" do
put "/jimmy/tasks/private/projects/world-domination/start", "write a manifesto"
get "/jimmy/tasks/private/"
last_response.status.must_equal 200
content = JSON.parse(last_response.body)
content.must_include "projects/"
content["projects/"].to_s.must_match /\d+/
content["projects/"].to_s.length.must_be :>=, 10
end
it "does not update existing directory objects" do
tasks_timestamp = directory_bucket.get("jimmy:tasks").last_modified
wait_a_second
put "/jimmy/tasks/private/projects/world-domination/start", "write a manifesto"
tasks_object = directory_bucket.get("jimmy:tasks")
tasks_object.last_modified.must_equal tasks_timestamp
end
end
end
context "for a sub-directory" do