From a349db524308acc3c4dd157dd33598224c4d76c8 Mon Sep 17 00:00:00 2001 From: Garret Alfert Date: Thu, 2 Jun 2016 16:45:17 +0200 Subject: [PATCH] Spec for directory listing of non-existing directories --- spec/swift/app_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/swift/app_spec.rb b/spec/swift/app_spec.rb index 10bc259..87dcc37 100644 --- a/spec/swift/app_spec.rb +++ b/spec/swift/app_spec.rb @@ -350,6 +350,16 @@ describe "App" do content["items"]["food/"]["ETag"].must_equal "f9f85fbf5aa1fa378fd79ac8aa0a457d" end + it "responds with 200 and empty object when directory doesn't exist" do + get "phil/some-non-existing-dir/" + + last_response.status.must_equal 200 + last_response.content_type.must_equal "application/ld+json" + + content = JSON.parse(last_response.body) + content["items"].must_equal({}) + end + end end