Commit e322bdbd5ea9de9bf2b7a5c1efb115e294289918
Exists in
spb-stable
and in
3 other branches
Merge branch 'fix/test' of /mnt/ebs/repositories/jhworth.developer/gitlab-ce
Showing
3 changed files
with
5 additions
and
9 deletions
Show diff stats
app/mailers/notify.rb
... | ... | @@ -12,7 +12,7 @@ class Notify < ActionMailer::Base |
12 | 12 | |
13 | 13 | default_url_options[:host] = Gitlab.config.gitlab.host |
14 | 14 | default_url_options[:protocol] = Gitlab.config.gitlab.protocol |
15 | - default_url_options[:port] = Gitlab.config.gitlab.port if Gitlab.config.gitlab_on_non_standard_port? | |
15 | + default_url_options[:port] = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port? | |
16 | 16 | default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root |
17 | 17 | |
18 | 18 | default from: Gitlab.config.gitlab.email_from | ... | ... |
config/initializers/1_settings.rb
... | ... | @@ -3,8 +3,8 @@ class Settings < Settingslogic |
3 | 3 | namespace Rails.env |
4 | 4 | |
5 | 5 | class << self |
6 | - def gitlab_on_non_standard_port? | |
7 | - ![443, 80].include?(gitlab.port.to_i) | |
6 | + def gitlab_on_standard_port? | |
7 | + gitlab.port.to_i == (gitlab.https ? 443 : 80) | |
8 | 8 | end |
9 | 9 | |
10 | 10 | private |
... | ... | @@ -18,11 +18,7 @@ class Settings < Settingslogic |
18 | 18 | end |
19 | 19 | |
20 | 20 | def build_gitlab_url |
21 | - if gitlab_on_non_standard_port? | |
22 | - custom_port = ":#{gitlab.port}" | |
23 | - else | |
24 | - custom_port = nil | |
25 | - end | |
21 | + custom_port = gitlab_on_standard_port? ? nil : ":#{gitlab.port}" | |
26 | 22 | [ gitlab.protocol, |
27 | 23 | "://", |
28 | 24 | gitlab.host, | ... | ... |
spec/models/project_spec.rb
... | ... | @@ -101,7 +101,7 @@ describe Project do |
101 | 101 | |
102 | 102 | it "returns the web URL without the protocol for this repo" do |
103 | 103 | project = Project.new(path: "somewhere") |
104 | - project.web_url_without_protocol.should == "#{Gitlab.config.gitlab.host}/somewhere" | |
104 | + project.web_url_without_protocol.should == "#{Gitlab.config.gitlab.url.split("://")[1]}/somewhere" | |
105 | 105 | end |
106 | 106 | |
107 | 107 | describe "last_activity methods" do | ... | ... |