summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2013-10-17 10:42:39 +0200
committerMarin Jankovski <maxlazio@gmail.com>2013-10-17 10:42:39 +0200
commitff046c72004f0c00827d615a60f37153f54a6347 (patch)
tree211f7a5eae81e91191fea614f5ba953a5d223cb0 /spec/helpers
parente9142c6f2cfcdf9a13bce375579085bd5ce00947 (diff)
downloadgitlab-ce-ff046c72004f0c00827d615a60f37153f54a6347.tar.gz
Fallback to internal issue tracker if config is invalid.
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/issues_helper_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb
index 3595af32431..9c95bc044f3 100644
--- a/spec/helpers/issues_helper_spec.rb
+++ b/spec/helpers/issues_helper_spec.rb
@@ -47,6 +47,17 @@ describe IssuesHelper do
url_for_project_issues.should eq ""
end
+
+ describe "when external tracker was enabled and then config removed" do
+ before do
+ @project = ext_project
+ Gitlab.config.stub(:issues_tracker).and_return(nil)
+ end
+
+ it "should return path to internal tracker" do
+ url_for_project_issues.should match(polymorphic_path([@project]))
+ end
+ end
end
describe :url_for_issue do
@@ -75,6 +86,17 @@ describe IssuesHelper do
url_for_issue(issue.iid).should eq ""
end
+
+ describe "when external tracker was enabled and then config removed" do
+ before do
+ @project = ext_project
+ Gitlab.config.stub(:issues_tracker).and_return(nil)
+ end
+
+ it "should return internal path" do
+ url_for_issue(issue.iid).should match(polymorphic_path([@project, issue]))
+ end
+ end
end
describe :url_for_new_issue do
@@ -101,6 +123,17 @@ describe IssuesHelper do
url_for_new_issue.should eq ""
end
+
+ describe "when external tracker was enabled and then config removed" do
+ before do
+ @project = ext_project
+ Gitlab.config.stub(:issues_tracker).and_return(nil)
+ end
+
+ it "should return internal path" do
+ url_for_new_issue.should match(new_project_issue_path(@project))
+ end
+ end
end
end