Replaced rfpdf with prawn and prawnto. Start to convert pdf-views.
This commit is contained in:
parent
da309f03b0
commit
a6c7b04e33
165 changed files with 723 additions and 28123 deletions
39
vendor/plugins/prawnto/test/base_template_handler_test.rb
vendored
Normal file
39
vendor/plugins/prawnto/test/base_template_handler_test.rb
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
require 'rubygems'
|
||||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/template_handler_test_mocks'
|
||||
require File.dirname(__FILE__) + '/../lib/prawnto'
|
||||
#require File.dirname(__FILE__) + '/../init'
|
||||
|
||||
|
||||
#TODO: ruby1.9: pull same testing scheme from Raw once we're on 1.9
|
||||
class BaseTemplateHandlerTest < Test::Unit::TestCase
|
||||
include TemplateHandlerTestMocks
|
||||
|
||||
def setup
|
||||
@view = ActionView.new
|
||||
@handler = Prawnto::TemplateHandlers::Base.new(@view)
|
||||
@controller = @view.controller
|
||||
end
|
||||
|
||||
def test_headers_disposition_inline_and_filename
|
||||
@controller.prawnto :filename=>'xxx.pdf', :inline=>true
|
||||
@handler.pull_prawnto_options
|
||||
@handler.set_disposition
|
||||
assert_equal 'inline;filename=xxx.pdf', @view.headers['Content-Disposition']
|
||||
end
|
||||
|
||||
def test_headers_disposition_attachment_and_filename
|
||||
@controller.prawnto :filename=>'xxx.pdf', :inline=>false
|
||||
@handler.pull_prawnto_options
|
||||
@handler.set_disposition
|
||||
assert_equal 'attachment;filename=xxx.pdf', @view.headers['Content-Disposition']
|
||||
end
|
||||
|
||||
def test_headers_disposition_default
|
||||
@handler.pull_prawnto_options
|
||||
@handler.set_disposition
|
||||
assert_equal 'inline', @view.headers['Content-Disposition']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue