Skip to content

Commit

Permalink
adding a spec !
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdarde authored and jdpace committed Jul 16, 2010
1 parent db5000e commit 891b1ab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spec/middleware_spec.rb
Expand Up @@ -19,13 +19,18 @@
body = @pdf.send :translate_paths, @body, @env
body.should == "<link href=\"http://example.com/stylesheets/application.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />"
end

it "should return the body even if there are no valid substitutions found" do
@body = "NO MATCH"
body = @pdf.send :translate_paths, @body, @env
body.should == "NO MATCH"
end

it "should detect special pdfkit meta tags" do
@body = %{<html><head><meta name="pdfkit" content="http://www.example.com/header.html" data-option-name="header" /></head></html>}
body = @pdf.send :find_options_in_meta, @body
body.should have_key(:header)
end
end

describe "#set_request_to_render_as_pdf" do
Expand All @@ -45,7 +50,6 @@
it "should replace .pdf in REQUEST_URI when the extname is .pdf" do
@pdf.send :set_request_to_render_as_pdf, @pdf_env
@pdf_env['REQUEST_URI'].should == "file"
end

end
end
end

0 comments on commit 891b1ab

Please sign in to comment.