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
38
vendor/plugins/prawnto/test/action_controller_test.rb
vendored
Normal file
38
vendor/plugins/prawnto/test/action_controller_test.rb
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
require 'rubygems'
|
||||
require 'action_controller'
|
||||
require 'action_controller/test_process'
|
||||
require 'action_view'
|
||||
|
||||
require 'test/unit'
|
||||
require File.dirname(__FILE__) + '/../lib/prawnto'
|
||||
|
||||
|
||||
class ActionControllerTest < Test::Unit::TestCase
|
||||
class PrawntoController < ActionController::Base
|
||||
prawnto :inline=>true, :prawn=>{:page_orientation=>:landscape}
|
||||
|
||||
def test
|
||||
prawnto :inline=>false, :prawn=>{:page_size=>'A4'}
|
||||
end
|
||||
end
|
||||
|
||||
def test_inheritable_options
|
||||
assert_equal({:page_orientation=>:landscape}, PrawntoController.read_inheritable_attribute(:prawn))
|
||||
assert_equal({:inline=>true}, PrawntoController.read_inheritable_attribute(:prawnto))
|
||||
end
|
||||
|
||||
def test_computed_options
|
||||
controller = PrawntoController.new
|
||||
test_process(controller)
|
||||
assert_equal({:inline=>false, :prawn=>{:page_orientation=>:landscape, :page_size=>'A4'}}, controller.send(:compute_prawnto_options))
|
||||
end
|
||||
|
||||
protected
|
||||
def test_process(controller, action = "test")
|
||||
request = ActionController::TestRequest.new
|
||||
request.action = action
|
||||
controller.process(request, ActionController::TestResponse.new)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue