From 8ec6004a7f1bc631f90e7fb1e63786f6cf14f757 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 27 Dec 2013 03:25:32 +0000 Subject: [PATCH] fix find_all_by_id(n1, n2) parameter at test_show_export_to_pdf_with_changesets of IssuesControllerTest find_all_by_id(n1, n2) returns only n1 result. git-svn-id: http://svn.redmine.org/redmine/trunk@12467 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 0431bb198..9fe0b2dca 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1425,12 +1425,17 @@ class IssuesControllerTest < ActionController::TestCase 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') + [[100], [100, 101], [100, 101, 102]].each do |cs| + issue1 = Issue.find(3) + issue1.changesets = Changeset.find(cs) + issue1.save! + issue = Issue.find(3) + assert_equal issue.changesets.count, cs.size + get :show, :id => 3, :format => 'pdf' + assert_response :success + assert_equal 'application/pdf', @response.content_type + assert @response.body.starts_with?('%PDF') + end end def test_show_invalid_should_respond_with_404 -- 2.39.5