Displaying special page when syncing. 404 instead of redirection

This commit is contained in:
Tomasz Drwięga
2016-09-01 11:16:19 +02:00
parent 9c4d31f548
commit 89f1444c51
9 changed files with 157 additions and 43 deletions

View File

@@ -57,7 +57,7 @@ fn should_redirect_to_home_when_trailing_slash_is_missing() {
}
#[test]
fn should_redirect_to_home_on_invalid_dapp() {
fn should_display_404_on_invalid_dapp() {
// given
let server = serve();
@@ -72,12 +72,12 @@ fn should_redirect_to_home_on_invalid_dapp() {
);
// then
assert_eq!(response.status, "HTTP/1.1 302 Found".to_owned());
assert_eq!(response.headers.get(0).unwrap(), "Location: /home/");
assert_eq!(response.status, "HTTP/1.1 404 Not Found".to_owned());
assert!(response.body.contains("href=\"/home/"));
}
#[test]
fn should_redirect_to_home_on_invalid_dapp_with_domain() {
fn should_display_404_on_invalid_dapp_with_domain() {
// given
let server = serve();
@@ -92,8 +92,8 @@ fn should_redirect_to_home_on_invalid_dapp_with_domain() {
);
// then
assert_eq!(response.status, "HTTP/1.1 302 Found".to_owned());
assert_eq!(response.headers.get(0).unwrap(), "Location: http://home.parity/");
assert_eq!(response.status, "HTTP/1.1 404 Not Found".to_owned());
assert!(response.body.contains("href=\"http://home.parity/"));
}
#[test]