Add test to show the truncation of response source with a null byte

Supports #322
This commit is contained in:
Dan Ivovich 2012-04-18 19:35:12 -04:00
parent 1ef8f4c844
commit 4e47ea9f99
1 changed files with 15 additions and 0 deletions

View File

@ -1500,4 +1500,19 @@ describe Capybara::Driver::Webkit do
it_behaves_like "a keyupdown app"
end
context "null byte app" do
before(:all) do
@app = lambda do |env|
body = "Hello\0World"
[200,
{ 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s },
[body]]
end
end
it "should include all the bytes in the source" do
subject.source.should == "Hello\0World"
end
end
end