diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-27 07:55:30 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-27 07:55:30 +0000 |
commit | e322bdbd5ea9de9bf2b7a5c1efb115e294289918 (patch) | |
tree | de35308c2012f8a804930b4ba716cd85900b4d59 | |
parent | 3713fc6cdfc45506668a1678503fac8e48221df0 (diff) | |
parent | 39a2adf4f49981dda9ab3e0d6a23b74acccbe128 (diff) | |
download | gitlab-ce-e322bdbd5ea9de9bf2b7a5c1efb115e294289918.tar.gz |
Merge branch 'fix/test' of /mnt/ebs/repositories/jhworth.developer/gitlab-ce
-rw-r--r-- | app/mailers/notify.rb | 2 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 10 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index aec4c57cba8..6c1a3328960 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -12,7 +12,7 @@ class Notify < ActionMailer::Base default_url_options[:host] = Gitlab.config.gitlab.host default_url_options[:protocol] = Gitlab.config.gitlab.protocol - default_url_options[:port] = Gitlab.config.gitlab.port if Gitlab.config.gitlab_on_non_standard_port? + default_url_options[:port] = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port? default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root default from: Gitlab.config.gitlab.email_from diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index ea391ca601c..cf6c79bb50e 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -3,8 +3,8 @@ class Settings < Settingslogic namespace Rails.env class << self - def gitlab_on_non_standard_port? - ![443, 80].include?(gitlab.port.to_i) + def gitlab_on_standard_port? + gitlab.port.to_i == (gitlab.https ? 443 : 80) end private @@ -18,11 +18,7 @@ class Settings < Settingslogic end def build_gitlab_url - if gitlab_on_non_standard_port? - custom_port = ":#{gitlab.port}" - else - custom_port = nil - end + custom_port = gitlab_on_standard_port? ? nil : ":#{gitlab.port}" [ gitlab.protocol, "://", gitlab.host, diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 6837e4c9196..6bae5951b7b 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -101,7 +101,7 @@ describe Project do it "returns the web URL without the protocol for this repo" do project = Project.new(path: "somewhere") - project.web_url_without_protocol.should == "#{Gitlab.config.gitlab.host}/somewhere" + project.web_url_without_protocol.should == "#{Gitlab.config.gitlab.url.split("://")[1]}/somewhere" end describe "last_activity methods" do |