]> source.dussan.org Git - redmine.git/commitdiff
fix find_all_by_id(n1, n2) parameter at test_show_export_to_pdf_with_changesets of...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 27 Dec 2013 03:25:32 +0000 (03:25 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 27 Dec 2013 03:25:32 +0000 (03:25 +0000)
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

index 0431bb1988ae57feaa2d88a88cf403d4fcc57c5b..9fe0b2dca293665eb7bd18b614bda2b37b1b4c0d 100644 (file)
@@ -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