Skip to content
Snippets Groups Projects
Commit c643b50d authored by Andrew8xx8's avatar Andrew8xx8
Browse files

Default value for issues_tracker setting added

parent 9b606ede
No related branches found
No related tags found
1 merge request!2967Basic support for external issues tracker
Loading
Loading
@@ -96,7 +96,7 @@ class Project < ActiveRecord::Base
scope :joined, ->(user) { where("namespace_id != ?", user.namespace_id) }
scope :public_only, -> { where(public: true) }
 
enumerize :issues_tracker, :in => (Settings[:issues_tracker].keys).append(:gitlab), :default => :gitlab
enumerize :issues_tracker, :in => (Gitlab.config.issues_tracker.keys).append(:gitlab), :default => :gitlab
 
class << self
def abandoned
Loading
Loading
Loading
Loading
@@ -143,7 +143,10 @@ development:
<<: *defaults
 
test:
<<: *base
<<: *defaults
issues_tracker:
redmine:
issues_url: "http://redmine/:project_id/:issues_tracker_id/:id"
 
staging:
<<: *defaults
Loading
Loading
@@ -42,6 +42,8 @@ Settings['omniauth'] ||= Settingslogic.new({})
Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil?
Settings.omniauth['providers'] ||= []
 
Settings['issues_tracker'] ||= {}
#
# GitLab
#
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ describe IssuesHelper do
 
describe :url_for_issue do
let(:issue_id) { 3 }
let(:issues_url) { "http://redmine/:project_id/:issues_tracker_id/:id" }
let(:issues_url) { Gitlab.config.issues_tracker.redmine.issues_url}
let(:ext_expected) do
issues_url.gsub(':id', issue_id.to_s)
.gsub(':project_id', ext_project.id.to_s)
Loading
Loading
@@ -40,7 +40,6 @@ describe IssuesHelper do
 
it "should return path to external tracker" do
@project = ext_project
Settings[:issues_tracker][ext_project.issues_tracker]["issues_url"] = issues_url
 
url_for_issue(issue_id).should match(ext_expected)
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment