summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-11 16:03:43 -0600
committermo khan <mo@mokhan.ca>2025-07-11 16:03:43 -0600
commitcbb77bed42e4acbf66ba882db262977615637261 (patch)
tree4bff35abe66564f13f55909234728a38b3982e10
parent1e5a4e35628324e8b008de1dc061ae110e1dcf67 (diff)
test: add test to ensure access to the sparkle homepage in dev
-rw-r--r--tests/authorization/cedar_authorizer_test.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/authorization/cedar_authorizer_test.rs b/tests/authorization/cedar_authorizer_test.rs
index f056c8c7..7a99a7d9 100644
--- a/tests/authorization/cedar_authorizer_test.rs
+++ b/tests/authorization/cedar_authorizer_test.rs
@@ -111,4 +111,21 @@ mod tests {
let authorizer = subject_with(entities);
assert!(!authorizer.authorize(request.clone()));
}
+
+ #[test]
+ fn test_sparkle_homepage() {
+ let request = build_request(|item: &mut HttpRequest| {
+ item.method = "GET".to_string();
+ item.path = "/".to_string();
+ item.host = "localhost:10000".to_string();
+ item.headers = build_headers(vec![
+ (String::from(":path"), item.path.to_string()),
+ (String::from(":method"), item.method.to_string()),
+ (String::from(":authority"), item.host.to_string()),
+ ]);
+ });
+
+ let authorizer = subject();
+ assert_eq!(authorizer.authorize(request), true);
+ }
}