0002-Return-to-version-page-after-the-issue-is-created.patch

Marius BALTEANU, 2019-06-25 19:04

Download (2.36 KB)

View differences:

app/helpers/versions_helper.rb
91 91
          :tracker_id => new_issue_tracker,
92 92
          :fixed_version_id => version.id
93 93
        }
94
        link_to l(:label_issue_new), new_project_issue_path(project, :issue => attrs), :class => 'icon icon-add'
94
        link_to l(:label_issue_new), new_project_issue_path(project, :issue => attrs, :back_url => version_path(version)), :class => 'icon icon-add'
95 95
      end
96 96
    end
97 97
  end
test/helpers/version_helper_test.rb
62 62
    # href should contain the following params:
63 63
    # fixed_version_id=3
64 64
    # tracker_id=1
65
    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=1', :text => 'New issue'
65
    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?back_url=%2Fversions%2F3&issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=1', :text => 'New issue'
66 66
  end
67 67

  
68 68
  def test_link_to_new_issue_should_return_nil_if_version_status_is_not_open
......
107 107
    User.current = User.find(2)
108 108

  
109 109
    # href should contain param tracker_id=2 because for tracker_id 1, user has only readonly permissions on fixed_version_id
110
    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=2'
110
    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?back_url=%2Fversions%2F3&issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=2'
111 111
  end
112 112
end
113
-