Search
Project
General
Profile
Home
Projects
Help
Sign in
Register
Search
:
Redmine
All Projects
Redmine
Overview
Download
Activity
Roadmap
Issues
News
Wiki
Plugins
Forums
Repository
Download (749 Bytes)
Feature #40266
» issues_pdf_redmine_helper_test.rb
Yazan Al aeddin
, 2024-02-19 14:27
# frozen_string_literal: true
require
File
.
expand_path
(
'../../../../../../test_helper'
,
__FILE__
)
require
'pdf/reader'
class
IssuesPdfRedmineHelperTest
<
Redmine
::
HelperTest
fixtures
:issues
include
Redmine
::
Export
::
PDF
::
IssuesPdfHelper
def
test_issue_to_pdf_should_create_attachment_links
issue
=
Issue
.
find
(
2
)
result
=
issue_to_pdf
(
issue
)
pdf_reader
=
PDF
::
Reader
.
new
(
StringIO
.
new
(
result
))
assert
pdf_reader
.
pages
.
any?
{
|
page
|
page
.
text
.
include?
(
"
#{
issue
.
subject
}
"
)
},
"The expected subject is not present in the PDF"
issue
.
attachments
.
each
do
|
attachment
|
link
=
link_to_attachment
(
attachment
,
{})
assert_equal
(
true
,
result
.
include?
(
"(http://test.host/attachments/
#{
attachment
.
id
}
)"
))
end
end
end
« Previous
1
2
3
4
5
Next »
(2-2/5)
Loading...