summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 07:58:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 07:58:02 +0000
commit424a70978ed71bb7ef6fbf6093d66ac67772651b (patch)
treedb9d7d905cea49b441b8bd9cc1a224312c0b8c71 /test/functional
parent24e6dbc70947cdb5aeaccf63d312289aac986f65 (diff)
downloadredmine-424a70978ed71bb7ef6fbf6093d66ac67772651b.tar.gz
redmine-424a70978ed71bb7ef6fbf6093d66ac67772651b.zip
Additional tests for the PDF export of an issue.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9445 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index e039468c2..adb7ebf2f 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -1169,6 +1169,42 @@ class IssuesControllerTest < ActionController::TestCase
assert_not_nil assigns(:issue)
end
+ def test_show_export_to_pdf_with_ancestors
+ issue = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1)
+
+ get :show, :id => issue.id, :format => 'pdf'
+ assert_response :success
+ assert_equal 'application/pdf', @response.content_type
+ assert @response.body.starts_with?('%PDF')
+ end
+
+ def test_show_export_to_pdf_with_descendants
+ c1 = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1)
+ c2 = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1)
+ c3 = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => c1.id)
+
+ get :show, :id => 1, :format => 'pdf'
+ assert_response :success
+ assert_equal 'application/pdf', @response.content_type
+ assert @response.body.starts_with?('%PDF')
+ end
+
+ def test_show_export_to_pdf_with_journals
+ get :show, :id => 1, :format => 'pdf'
+ assert_response :success
+ assert_equal 'application/pdf', @response.content_type
+ assert @response.body.starts_with?('%PDF')
+ end
+
+ def test_show_export_to_pdf_with_changesets
+ Issue.find(3).changesets = Changeset.find_all_by_id(100, 101, 102)
+
+ get :show, :id => 3, :format => 'pdf'
+ assert_response :success
+ assert_equal 'application/pdf', @response.content_type
+ assert @response.body.starts_with?('%PDF')
+ end
+
def test_get_new
@request.session[:user_id] = 2
get :new, :project_id => 1, :tracker_id => 1