s = ''.html_safe
relations.each do |relation|
other_issue = relation.other_issue(issue)
- css = "issue hascontextmenu #{other_issue.css_classes}"
+ css = "issue hascontextmenu #{other_issue.css_classes} #{relation.css_classes_for(other_issue)}"
buttons =
if manage_relations
link_to(
assert_include '<a href="/issues?issue_id=15%2C16&set_filter=true&status_id=c">1 closed</a>', html
end
+ def test_render_issue_relations
+ issue = Issue.generate!(:status_id => 1)
+ closed_issue = Issue.generate!(:status_id => 5)
+ relation = IssueRelation.create!(:issue_from => closed_issue,
+ :issue_to => issue,
+ :relation_type => IssueRelation::TYPE_FOLLOWS)
+
+ html = render_issue_relations(issue, [relation])
+ assert_include "<tr id=\"relation-#{relation.id}\" class=\"issue hascontextmenu issue tracker-#{closed_issue.tracker_id} status-#{closed_issue.status_id} priority-#{closed_issue.priority_id} priority-default closed rel-follows\">", html
+
+ html = render_issue_relations(closed_issue, [relation])
+ assert_include "<tr id=\"relation-#{relation.id}\" class=\"issue hascontextmenu issue tracker-#{issue.tracker_id} status-#{issue.status_id} priority-#{issue.priority_id} priority-default rel-precedes\">", html
+ end
+
def test_render_descendants_stats
parent = Issue.generate!(:status_id => 1)
child = Issue.generate!(:parent_issue_id => parent.id, :status_id => 1)