diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-03-26 12:27:34 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-03-26 12:28:26 +0400 |
commit | 242f6aa218da6385b08d28705eb42297d899c089 (patch) | |
tree | 2f517529e6a80f456c8af1c5d5a073577bcf53a9 /spec/helpers/issues_helper_spec.rb | |
parent | 90db28d6d0a031cad8dc58bc5936e381ce82a764 (diff) | |
download | gitlab-ce-242f6aa218da6385b08d28705eb42297d899c089.tar.gz |
New issue button was not follows to external tracker if it is selected. fixed #3386
Diffstat (limited to 'spec/helpers/issues_helper_spec.rb')
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index c9eb6591561..a1f23073582 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -76,4 +76,31 @@ describe IssuesHelper do url_for_issue(issue.id).should eq "" end end + + describe :url_for_new_issue do + let(:issues_url) { Gitlab.config.issues_tracker.redmine.new_issue_url} + let(:ext_expected) do + issues_url.gsub(':project_id', ext_project.id.to_s) + .gsub(':issues_tracker_id', ext_project.issues_tracker_id.to_s) + end + let(:int_expected) { new_project_issue_path(project) } + + it "should return internal path if used internal tracker" do + @project = project + url_for_new_issue.should match(int_expected) + end + + it "should return path to external tracker" do + @project = ext_project + + url_for_new_issue.should match(ext_expected) + end + + it "should return empty string if project nil" do + @project = nil + + url_for_new_issue.should eq "" + end + end + end |