@@ -50,7 +50,7 class IssueRelationsController < ApplicationController | |||
|
50 | 50 | respond_to do |format| |
|
51 | 51 | format.html { redirect_to issue_path(@issue) } |
|
52 | 52 | format.js { |
|
53 | @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
|
53 | @relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
|
54 | 54 | } |
|
55 | 55 | format.api { |
|
56 | 56 | if saved |
@@ -187,6 +187,7 class Issue < ActiveRecord::Base | |||
|
187 | 187 | def reload(*args) |
|
188 | 188 | @workflow_rule_by_attribute = nil |
|
189 | 189 | @assignable_versions = nil |
|
190 | @relations = nil | |
|
190 | 191 | super |
|
191 | 192 | end |
|
192 | 193 |
@@ -28,7 +28,8 class IssueRelationsControllerTest < ActionController::TestCase | |||
|
28 | 28 | :issue_relations, |
|
29 | 29 | :enabled_modules, |
|
30 | 30 | :enumerations, |
|
31 | :trackers | |
|
31 | :trackers, | |
|
32 | :projects_trackers | |
|
32 | 33 | |
|
33 | 34 | def setup |
|
34 | 35 | User.current = nil |
@@ -87,6 +88,17 class IssueRelationsControllerTest < ActionController::TestCase | |||
|
87 | 88 | end |
|
88 | 89 | end |
|
89 | 90 | |
|
91 | def test_create_follows_relation_should_update_relations_list | |
|
92 | issue1 = Issue.generate!(:subject => 'Followed issue', :start_date => Date.yesterday, :due_date => Date.today) | |
|
93 | issue2 = Issue.generate! | |
|
94 | ||
|
95 | assert_difference 'IssueRelation.count' do | |
|
96 | xhr :post, :create, :issue_id => issue2.id, | |
|
97 | :relation => {:issue_to_id => issue1.id, :relation_type => 'follows', :delay => ''} | |
|
98 | end | |
|
99 | assert_match /Followed issue/, response.body | |
|
100 | end | |
|
101 | ||
|
90 | 102 | def test_should_create_relations_with_visible_issues_only |
|
91 | 103 | Setting.cross_project_issue_relations = '1' |
|
92 | 104 | assert_nil Issue.visible(User.find(3)).find_by_id(4) |
General Comments 0
You need to be logged in to leave comments.
Login now