diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-07-10 10:38:42 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-07-24 09:13:43 +0300 |
commit | 7bee7b848aab883a6869e1fd2fbb9e66182d2023 (patch) | |
tree | 286029930e7c9af9402a752a1dd6f2ab9c607776 /spec/helpers | |
parent | 2fa22a07296223c1239bfab94654487cca222097 (diff) |
Support both internal and external issue trackers
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 8f7f17a484f..9524a101e74 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -8,7 +8,7 @@ describe IssuesHelper do describe "url_for_issue" do let(:issues_url) { ext_project.external_issue_tracker.issues_url} let(:ext_expected) { issues_url.gsub(':id', issue.iid.to_s).gsub(':project_id', ext_project.id.to_s) } - let(:int_expected) { polymorphic_path([@project.namespace, project, issue]) } + let(:int_expected) { polymorphic_path([@project.namespace, @project, issue]) } it "returns internal path if used internal tracker" do @project = project @@ -22,6 +22,12 @@ describe IssuesHelper do expect(url_for_issue(issue.iid)).to match(ext_expected) end + it "returns path to internal issue when internal option passed" do + @project = ext_project + + expect(url_for_issue(issue.iid, ext_project, internal: true)).to match(int_expected) + end + it "returns empty string if project nil" do @project = nil |