summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-12-22 10:15:49 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-22 10:15:49 +0000
commit7fc64dd18d9b2b6e3a2a01dab0007f7dd25c37ed (patch)
tree428602d5265cd981a2e33ace8aed6fc9594dd37c /spec/helpers
parentfd3ab00cf90ddf081c61fb701721ca9180378bba (diff)
parent6d9c1d3efce00da95832feaaf36227bcbffecadf (diff)
downloadgitlab-ce-pipeline-ui-updates.tar.gz
Merge branch 'master' into pipeline-ui-updatespipeline-ui-updates
* master: (259 commits) Exclude non existent repository storages. fixed minor animation glitch in mini pipeline graph animation Update Bitbucket callback URL documentation Update build step for KaTeX. Add KaTeX fonts to assets paths and precompile Replace url('...') to url(font-path('...')) Rname katex.css to katex.scss Revert conflicting EE changes Added Autodeploy script for OpenShift Whitelist next project names: notes, services Put back progress bar CSS Remove unneeded bundle refs. Adds entry to changelog Reduce MR widget title by one pixel Use same font size for all items in issue title Adds background color for disabled state to merge when succeeds dropdown Filter protocol-relative URLs in ExternalLinkFilter. Fixes issue #22742. Move javascript for widget check to ci_bundle. Introduce "Set up autodeploy" button to help configure GitLab CI for deployment Whitelist next project names: help, ci, admin, search ...
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/import_helper_spec.rb33
1 files changed, 23 insertions, 10 deletions
diff --git a/spec/helpers/import_helper_spec.rb b/spec/helpers/import_helper_spec.rb
index 187b891b927..10f293cddf5 100644
--- a/spec/helpers/import_helper_spec.rb
+++ b/spec/helpers/import_helper_spec.rb
@@ -25,24 +25,37 @@ describe ImportHelper do
end
end
- describe '#github_project_link' do
- context 'when provider does not specify a custom URL' do
- it 'uses default GitHub URL' do
- allow(Gitlab.config.omniauth).to receive(:providers).
+ describe '#provider_project_link' do
+ context 'when provider is "github"' do
+ context 'when provider does not specify a custom URL' do
+ it 'uses default GitHub URL' do
+ allow(Gitlab.config.omniauth).to receive(:providers).
and_return([Settingslogic.new('name' => 'github')])
- expect(helper.github_project_link('octocat/Hello-World')).
+ expect(helper.provider_project_link('github', 'octocat/Hello-World')).
to include('href="https://github.com/octocat/Hello-World"')
+ end
end
- end
- context 'when provider specify a custom URL' do
- it 'uses custom URL' do
- allow(Gitlab.config.omniauth).to receive(:providers).
+ context 'when provider specify a custom URL' do
+ it 'uses custom URL' do
+ allow(Gitlab.config.omniauth).to receive(:providers).
and_return([Settingslogic.new('name' => 'github', 'url' => 'https://github.company.com')])
- expect(helper.github_project_link('octocat/Hello-World')).
+ expect(helper.provider_project_link('github', 'octocat/Hello-World')).
to include('href="https://github.company.com/octocat/Hello-World"')
+ end
+ end
+ end
+
+ context 'when provider is "gitea"' do
+ before do
+ assign(:gitea_host_url, 'https://try.gitea.io/')
+ end
+
+ it 'uses given host' do
+ expect(helper.provider_project_link('gitea', 'octocat/Hello-World')).
+ to include('href="https://try.gitea.io/octocat/Hello-World"')
end
end
end