Skip to content

Commit 7c8d598

Browse files
committed
test(ads-client): added additional unit test for staging URL to ensure runtime safety.
1 parent f763080 commit 7c8d598

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

components/ads-client/src/client/config.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,15 @@ mod tests {
7878
assert_eq!(url.host(), Some(Host::Domain("ads.mozilla.org")));
7979
assert_eq!(url.path(), "/v1/ads");
8080
}
81+
82+
#[test]
83+
fn staging_endpoint_parses_and_is_expected() {
84+
let url = Environment::Staging.into_url("ads");
85+
86+
assert_eq!(url.as_str(), "https://ads.allizom.org/v1/ads");
87+
88+
assert_eq!(url.scheme(), "https");
89+
assert_eq!(url.host(), Some(Host::Domain("ads.allizom.org")));
90+
assert_eq!(url.path(), "/v1/ads");
91+
}
8192
}

0 commit comments

Comments
 (0)