@@ -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 |
@@ -87,6 +87,17 class IssueRelationsControllerTest < ActionController::TestCase | |||
|
87 | 87 | end |
|
88 | 88 | end |
|
89 | 89 | |
|
90 | def test_create_follows_relation_should_update_relations_list | |
|
91 | issue1 = Issue.generate!(:subject => 'Followed issue', :start_date => Date.yesterday, :due_date => Date.today) | |
|
92 | issue2 = Issue.generate! | |
|
93 | ||
|
94 | assert_difference 'IssueRelation.count' do | |
|
95 | xhr :post, :create, :issue_id => issue2.id, | |
|
96 | :relation => {:issue_to_id => issue1.id, :relation_type => 'follows', :delay => ''} | |
|
97 | end | |
|
98 | assert_match /Followed issue/, response.body | |
|
99 | end | |
|
100 | ||
|
90 | 101 | def test_should_create_relations_with_visible_issues_only |
|
91 | 102 | Setting.cross_project_issue_relations = '1' |
|
92 | 103 | 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