Permalink
Browse files

added test

  • Loading branch information...
etehtsea authored and ches committed Jun 18, 2011
1 parent 2a268e1 commit 8dd6e8cdc17d17018ac9023e8b768c03f7f305b8
Showing with 10 additions and 0 deletions.
  1. +1 −0 lib/rack/gridfs.rb
  2. +1 −0 test/artifacts/тест.txt
  3. +8 −0 test/gridfs_test.rb
View
@@ -1,5 +1,6 @@
require 'mongo'
require 'mime/types'
+require 'cgi'
module Rack
class GridFSConnectionError < StandardError ; end
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet.
View
@@ -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?

0 comments on commit 8dd6e8c

Please sign in to comment.