Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added test

  • Loading branch information...
commit 8dd6e8cdc17d17018ac9023e8b768c03f7f305b8 1 parent 2a268e1
@etehtsea etehtsea authored ches committed
View
1  lib/rack/gridfs.rb
@@ -1,5 +1,6 @@
require 'mongo'
require 'mime/types'
+require 'cgi'
module Rack
class GridFSConnectionError < StandardError ; end
View
1  test/artifacts/тест.txt
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet.
View
8 test/gridfs_test.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'test_helper'
require 'pp'
@@ -159,6 +161,12 @@ def app; setup_endpoint(:lookup => :path) end
assert_equal 'text/plain', last_response.content_type
end
+ should "return TXT with non-ascii filename files stored in GridFS" do
+ @rus_text_file = load_artifact('тест.txt', nil, path='text')
+ get "/gridfs/#{CGI::escape(@rus_text_file.filename)}"
+ assert_equal "Lorem ipsum dolor sit amet.", last_response.body
+ end
+
should "return a not found for a unknown path" do
get '/gridfs/unknown'
assert last_response.not_found?
Please sign in to comment.
Something went wrong with that request. Please try again.