Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle unknown keys and images.

  • Loading branch information...
commit 701582490fa5a4324023b3ad5f5c7805874154b9 1 parent 07d0eae
@skinandbones authored
View
BIN  test/artifacts/3wolfmoon.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
18 test/rack/gridfs_test.rb
@@ -123,6 +123,24 @@ def load_artifact(filename, key, content_type)
get '/gridfs/test.html'
assert_equal 'text/html', last_response.content_type
end
+
+ should "return a not found for a unknown path" do
+ get '/gridfs/unknown'
+ assert last_response.not_found?
+ end
+
+ should "handle complex file paths" do
+ load_artifact('test.html', 'stuff/187d/foo.html', 'text/html')
+ get '/gridfs/stuff/187d/foo.html'
+ assert_equal 'text/html', last_response.content_type
+ end
+
+ should "work for small images" do
+ load_artifact('3wolfmoon.jpg', 'images/3wolfmoon.jpg', 'image/jpeg')
+ get '/gridfs/images/3wolfmoon.jpg'
+ assert last_response.ok?
+ assert_equal 'image/jpeg', last_response.content_type
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.