diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 18:07:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 18:07:52 +0300 |
commit | afe2b984524ae4b0c8a0636db7ec5b2c452f0734 (patch) | |
tree | 3de39f954c7239e09a9afe84263a64e7042b2b60 /spec/controllers/import | |
parent | 5a6b36b60502c50ab59c0bc3c345793b70a3d548 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/import')
-rw-r--r-- | spec/controllers/import/gitea_controller_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/controllers/import/gitea_controller_spec.rb b/spec/controllers/import/gitea_controller_spec.rb index 730e3f98c98..b4834dffdb3 100644 --- a/spec/controllers/import/gitea_controller_spec.rb +++ b/spec/controllers/import/gitea_controller_spec.rb @@ -28,10 +28,24 @@ describe Import::GiteaController do describe "GET status" do it_behaves_like 'a GitHub-ish import controller: GET status' do + let(:extra_assign_expectations) { { gitea_host_url: host_url } } + before do assign_host_url end - let(:extra_assign_expectations) { { gitea_host_url: host_url } } + + context 'when host url is local or not http' do + %w[https://localhost:3000 http://192.168.0.1 ftp://testing].each do |url| + let(:host_url) { url } + + it 'denies network request' do + get :status, format: :json + + expect(controller).to redirect_to(new_import_url) + expect(flash[:alert]).to eq('Specified URL cannot be used.') + end + end + end end end |