Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Schilling <2900-razer6@users.noreply.gitlab.com>2019-02-13 13:51:12 +0300
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-02-13 13:51:12 +0300
commitb178443854861befaa78798ee11273102767f28e (patch)
tree0a57fa61ea687e51e20ab35881ab68af6b5b496b /spec
parent2b68d0cdb36bf6b59efff9ca7209da65ed61777e (diff)
Add support for FTP assets for releases
Extend the list of supported protocols to include FTP.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/releases/link_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/releases/link_spec.rb b/spec/models/releases/link_spec.rb
index 06ed1438688..4dd26c976cc 100644
--- a/spec/models/releases/link_spec.rb
+++ b/spec/models/releases/link_spec.rb
@@ -77,4 +77,28 @@ describe Releases::Link do
it { is_expected.to be_truthy }
end
+
+ describe 'supported protocols' do
+ where(:protocol) do
+ %w(http https ftp)
+ end
+
+ with_them do
+ let(:link) { build(:release_link, url: protocol + '://assets.com/download') }
+
+ it 'will be valid' do
+ expect(link).to be_valid
+ end
+ end
+ end
+
+ describe 'unsupported protocol' do
+ context 'for torrent' do
+ let(:link) { build(:release_link, url: 'torrent://assets.com/download') }
+
+ it 'will be invalid' do
+ expect(link).to be_invalid
+ end
+ end
+ end
end