diff options
author | Jason Hollingsworth <jhworth.developer@gmail.com> | 2014-01-25 06:59:42 +0400 |
---|---|---|
committer | Jason Hollingsworth <jhworth.developer@gmail.com> | 2014-01-25 07:14:05 +0400 |
commit | 39a2adf4f49981dda9ab3e0d6a23b74acccbe128 (patch) | |
tree | 803c3f58e4fa305875ee9e3512b9e03e10cfb7eb /config | |
parent | ced4a37a186601b37121c19523955b96767d9af5 (diff) |
Fix broken test in spec/models/project_spec.rb
A test was broken if running on a non-standard port.
Made checking for (non-)standard port more robust.
Changed gitlab_on_non_standard_port to gitlab_on_standard_port (less negative).
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/1_settings.rb | 10 |
1 files changed, 3 insertions, 7 deletions
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, |