describe'#blocked_url?'doit'allows imports from configured web host and port'doimport_url="http://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/t.git"expect(described_class.blocked_url?(import_url)).tobefalseendit'allows imports from configured SSH host and port'doimport_url="http://#{Gitlab.config.gitlab_shell.ssh_host}:#{Gitlab.config.gitlab_shell.ssh_port}/t.git"expect(described_class.blocked_url?(import_url)).tobefalseendit'returns true for bad localhost hostname'doexpect(described_class.blocked_url?('https://localhost:65535/foo/foo.git')).tobetrueendit'returns true for bad port'doexpect(described_class.blocked_url?('https://gitlab.com:25/foo/foo.git')).tobetrueendit'returns true for invalid URL'doexpect(described_class.blocked_url?('http://:8080')).tobetrueendit'returns false for legitimate URL'doexpect(described_class.blocked_url?('https://gitlab.com/foo/foo.git')).tobefalseendendend