@@ -1169,6 +1169,42 class IssuesControllerTest < ActionController::TestCase | |||||
1169 | assert_not_nil assigns(:issue) |
|
1169 | assert_not_nil assigns(:issue) | |
1170 | end |
|
1170 | end | |
1171 |
|
1171 | |||
|
1172 | def test_show_export_to_pdf_with_ancestors | |||
|
1173 | issue = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1) | |||
|
1174 | ||||
|
1175 | get :show, :id => issue.id, :format => 'pdf' | |||
|
1176 | assert_response :success | |||
|
1177 | assert_equal 'application/pdf', @response.content_type | |||
|
1178 | assert @response.body.starts_with?('%PDF') | |||
|
1179 | end | |||
|
1180 | ||||
|
1181 | def test_show_export_to_pdf_with_descendants | |||
|
1182 | c1 = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1) | |||
|
1183 | c2 = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1) | |||
|
1184 | c3 = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => c1.id) | |||
|
1185 | ||||
|
1186 | get :show, :id => 1, :format => 'pdf' | |||
|
1187 | assert_response :success | |||
|
1188 | assert_equal 'application/pdf', @response.content_type | |||
|
1189 | assert @response.body.starts_with?('%PDF') | |||
|
1190 | end | |||
|
1191 | ||||
|
1192 | def test_show_export_to_pdf_with_journals | |||
|
1193 | get :show, :id => 1, :format => 'pdf' | |||
|
1194 | assert_response :success | |||
|
1195 | assert_equal 'application/pdf', @response.content_type | |||
|
1196 | assert @response.body.starts_with?('%PDF') | |||
|
1197 | end | |||
|
1198 | ||||
|
1199 | def test_show_export_to_pdf_with_changesets | |||
|
1200 | Issue.find(3).changesets = Changeset.find_all_by_id(100, 101, 102) | |||
|
1201 | ||||
|
1202 | get :show, :id => 3, :format => 'pdf' | |||
|
1203 | assert_response :success | |||
|
1204 | assert_equal 'application/pdf', @response.content_type | |||
|
1205 | assert @response.body.starts_with?('%PDF') | |||
|
1206 | end | |||
|
1207 | ||||
1172 | def test_get_new |
|
1208 | def test_get_new | |
1173 | @request.session[:user_id] = 2 |
|
1209 | @request.session[:user_id] = 2 | |
1174 | get :new, :project_id => 1, :tracker_id => 1 |
|
1210 | get :new, :project_id => 1, :tracker_id => 1 |
General Comments 0
You need to be logged in to leave comments.
Login now