We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d581864 commit 540829bCopy full SHA for 540829b
exercises/tiered_pricing/solutions/isaac1024_baby-steps/src/tiered_pricing.rs
@@ -142,4 +142,18 @@ mod tests {
142
143
assert_eq!(number_of_subscriptions * 149, response.pricing);
144
}
145
+
146
+ #[actix_web::test]
147
+ async fn when_send_0_subscriptions_return_bad_request() {
148
+ let app =
149
+ test::init_service(App::new().route("/pricing", web::get().to(tiered_pricing))).await;
150
151
+ let request = test::TestRequest::get()
152
+ .uri("/pricing?subscriptions=0")
153
+ .to_request();
154
155
+ let response = test::call_service(&app, request).await;
156
157
+ assert!(response.status().is_client_error())
158
+ }
159
0 commit comments