summaryrefslogtreecommitdiff
path: root/spec/controllers/help_controller_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-18 23:43:13 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-18 23:43:13 +0100
commitc1928f4fce2c1b6315723f8b4a2002eee094b477 (patch)
tree01c061f90c8513e45554953414cfbd0d6f007149 /spec/controllers/help_controller_spec.rb
parent1e62a13968cc4351684f919630cd426e20fc022a (diff)
parent546fa165ff728bc2d25ed9b55b95dd1d48139d4a (diff)
downloadgitlab-ce-improve-pipeline-fixtures.tar.gz
Merge remote-tracking branch 'origin/master' into improve-pipeline-fixturesimprove-pipeline-fixtures
Diffstat (limited to 'spec/controllers/help_controller_spec.rb')
-rw-r--r--spec/controllers/help_controller_spec.rb34
1 files changed, 16 insertions, 18 deletions
diff --git a/spec/controllers/help_controller_spec.rb b/spec/controllers/help_controller_spec.rb
index 6fc6ea95e13..d3489324a9c 100644
--- a/spec/controllers/help_controller_spec.rb
+++ b/spec/controllers/help_controller_spec.rb
@@ -8,35 +8,33 @@ describe HelpController do
end
describe 'GET #index' do
- context 'when url prefixed without /help/' do
- it 'has correct url prefix' do
- stub_readme("[API](api/README.md)")
+ context 'with absolute url' do
+ it 'keeps the URL absolute' do
+ stub_readme("[API](/api/README.md)")
+
get :index
- expect(assigns[:help_index]).to eq '[API](/help/api/README.md)'
+
+ expect(assigns[:help_index]).to eq '[API](/api/README.md)'
end
end
- context 'when url prefixed with help/' do
- it 'will be an absolute path' do
- stub_readme("[API](help/api/README.md)")
+ context 'with relative url' do
+ it 'prefixes it with /help/' do
+ stub_readme("[API](api/README.md)")
+
get :index
+
expect(assigns[:help_index]).to eq '[API](/help/api/README.md)'
end
end
- context 'when url prefixed with help' do
- it 'will be an absolute path' do
- stub_readme("[API](helpful_hints/README.md)")
- get :index
- expect(assigns[:help_index]).to eq '[API](/help/helpful_hints/README.md)'
- end
- end
+ context 'when url is an external link' do
+ it 'does not change it' do
+ stub_readme("[external](https://some.external.link)")
- context 'when url prefixed with /help/' do
- it 'will not be changed' do
- stub_readme("[API](/help/api/README.md)")
get :index
- expect(assigns[:help_index]).to eq '[API](/help/api/README.md)'
+
+ expect(assigns[:help_index]).to eq '[external](https://some.external.link)'
end
end
end