Skip to content

Commit

Permalink
Failing spec for the server getting stuck rendering pdfs on every req…
Browse files Browse the repository at this point in the history
…uest.
  • Loading branch information
mdeering committed May 9, 2011
1 parent f57d2c9 commit ae39ab8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/middleware_spec.rb
Expand Up @@ -152,4 +152,22 @@ def mock_app(options = {}, conditions = {})
end
end

it "should not get stuck rendering each request as pdf" do
mock_app
# false by default. No requests.
@app.send(:rendering_pdf?).should be_false

# Remain false on a normal request
get 'http://www.example.org/public/file'
@app.send(:rendering_pdf?).should be_false

# Return true on a pdf request.
get 'http://www.example.org/public/file.pdf'
@app.send(:rendering_pdf?).should be_true

# Restore to false on any non-pdf request.
get 'http://www.example.org/public/file'
@app.send(:rendering_pdf?).should be_false
end

end

0 comments on commit ae39ab8

Please sign in to comment.