Allow binary content (fixes #18)
This commit is contained in:
@@ -123,6 +123,26 @@ describe "Directories" do
|
||||
directory.data.to_i.must_equal object.meta['timestamp'][0].to_i
|
||||
end
|
||||
end
|
||||
|
||||
context "with binary data" do
|
||||
before do
|
||||
header "Content-Type", "image/jpeg; charset=binary"
|
||||
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
|
||||
@image = File.open(filename, "r").read
|
||||
put "/jimmy/tasks/jaypeg.jpg", @image
|
||||
end
|
||||
|
||||
it "lists the binary files" do
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
last_response.status.must_equal 200
|
||||
|
||||
content = JSON.parse(last_response.body)
|
||||
content.must_include "jaypeg.jpg"
|
||||
content["jaypeg.jpg"].must_be_kind_of Integer
|
||||
content["jaypeg.jpg"].to_s.length.must_equal 13
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "for a sub-directory" do
|
||||
|
||||
Reference in New Issue
Block a user