summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-19 10:34:36 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-19 10:34:36 -0300
commitdd227bda0b86ee588e75160526fd4b286212ddfd (patch)
tree9d842ce28d08ca8b527db097d066b7d7005f48e1
parenteb2c4f9d1976dc8bf35b8d94860ca617483c9967 (diff)
downloadgitlab-ce-imported-ghe-project-names-links-to-github.tar.gz
Rename GithubRoutingHelper to a more generic ImportHelperimported-ghe-project-names-links-to-github
-rw-r--r--app/helpers/import_helper.rb (renamed from app/helpers/github_routing_helper.rb)9
-rw-r--r--spec/helpers/import_helper_spec.rb (renamed from spec/helpers/github_routing_helper_spec.rb)2
2 files changed, 4 insertions, 7 deletions
diff --git a/app/helpers/github_routing_helper.rb b/app/helpers/import_helper.rb
index 77a3774eabc..109bc1a02d1 100644
--- a/app/helpers/github_routing_helper.rb
+++ b/app/helpers/import_helper.rb
@@ -1,4 +1,4 @@
-module GithubRoutingHelper
+module ImportHelper
def github_project_link(path_with_namespace)
link_to path_with_namespace, github_project_url(path_with_namespace), target: '_blank'
end
@@ -6,16 +6,13 @@ module GithubRoutingHelper
private
def github_project_url(path_with_namespace)
- File.join(github_root_url, path_with_namespace)
+ "#{github_root_url}/#{path_with_namespace}"
end
def github_root_url
return @github_url if defined?(@github_url)
provider = Gitlab.config.omniauth.providers.find { |p| p.name == 'github' }
-
- @github_url = if provider
- provider.fetch('url', 'https://github.com')
- end
+ @github_url = provider.fetch('url', 'https://github.com') if provider
end
end
diff --git a/spec/helpers/github_routing_helper_spec.rb b/spec/helpers/import_helper_spec.rb
index 7967fa72d00..3391234e9f5 100644
--- a/spec/helpers/github_routing_helper_spec.rb
+++ b/spec/helpers/import_helper_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-describe GithubRoutingHelper do
+describe ImportHelper do
describe '#github_project_link' do
context 'when provider does not specify a custom URL' do
it 'uses default GitHub URL' do