どうも。
古いメールにレスします。
本格的に私がTestLinkを使うようになり始めて、
RedmineからTestLinkへのリンクを望むようになりました。
TestLink v.1.8 で XML-RPC対応するとかありましたが、
待ってられないので強引なパッチを作成しましたので公開しておきます。
これは、文中に testlink#ID と記入することでtestlinkまでの直リンクなるパッチです。
# document#id のようなもの
TEST_LINK_ADDRESS という定数をconfig/environment.rb に作成していますが、
アドレスを直接helperに書いた方がいいかもです。
また、helper(とdocument)を見ればわかりますが、 testlink:ID とかにも対応可能ですし、
"testlink" の文字列も任意に変更して使用できますのでその辺りは好きに改善してください。
#------------パッチはここから-----
Index: config/environment.rb
===================================================================
--- config/environment.rb (リビジョン 1557)
+++ config/environment.rb (作業コピー)
@@ -98,5 +99,7 @@
GLoc.load_localized_strings
GLoc.set_config(:raise_string_not_found_errors => false)
+TEST_LINK_ADDRESS = "
http://hogehogeuri/testlink/lib/testcases/
archiveData.php?id=%d&edit=testcase&allow_edit=0"
+
require 'redmine'
Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb (リビジョン 1557)
+++ app/helpers/application_helper.rb (作業コピー)
@@ -306,7 +322,7 @@
# source:some/file#L120 -> Link to line 120 of the file
# source:some/file@52#L120 -> Link to line 120 of the file's
revision 52
# export:some/file -> Force the download of the file
- text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|
version|commit|source|export)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*|"[^"]
+"))(?=[[:punct:]]|\s|<|$)}) do |m|
+ text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|
version|commit|source|export|testlink)?((#|r)(\d+)|(:)([^"\s<>][^
\s<>]*|"[^"]+"))(?=[[:punct:]]|\s|<|$)}) do |m|
leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
link = nil
if esc.nil?
@@ -336,6 +352,8 @@
link = link_to h(
version.name), {:only_path =>
only_path, :controller => 'versions', :action => 'show', :id =>
version},
:class => 'version'
end
+ when 'testlink'
+ link = link_to("testlink##{oid}", TEST_LINK_ADDRESS %
oid)
end
elsif sep == ':'
# removes the double quotes if any
#------------ここまで-----
問題はTestLinkにログインしていないとダメな点と、
TestLink への直リン方法です。リンク方法はこれでいいのでしょうか・・・?
間違ってるようなら方法をご教授いただきたいです。
では。