Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hard check for the zip extension #6552

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class ZipImporterPagePresenter extends AbstractWizardPage<MutableProjectC
private static final RegExp URL_REGEX =
RegExp.compile("(https?|ftp)://(-\\.)?([^\\s/?\\.#-]+\\.?)+(/[^\\s]*)?");
private static final RegExp WHITESPACE = RegExp.compile("^\\s");
private static final RegExp END_URL = RegExp.compile(".zip$");

private CoreLocalizationConstant locale;
private ZipImporterPageView view;
Expand Down Expand Up @@ -159,11 +158,6 @@ private boolean isUrlCorrect(@NotNull String url) {
return false;
}

if (!END_URL.test(url)) {
view.showUrlError(locale.importProjectMessageUrlInvalid());
return false;
}

if (WHITESPACE.test(url)) {
view.showUrlError(locale.importProjectMessageStartWithWhiteSpace());
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ public void incorrectProjectUrlEnteredTest() {
verify(delegate).updateControls();
}

@Test
public void projectUrlWithoutZipEnteredTest() {
//url without .zip was entered
String incorrectUrl = "https://host.com/some/path/angularjs.ip";
when(view.getProjectName()).thenReturn("");

presenter.projectUrlChanged(incorrectUrl);

verify(view).showUrlError(anyString());
verify(delegate).updateControls();
}

@Test
public void projectUrlStartWithWhiteSpaceEnteredTest() {
when(view.getProjectName()).thenReturn("name");
Expand Down