Skip to content

Commit 43549a8

Browse files
committed
Test team name is lowercase when requested
1 parent 5d9f11c commit 43549a8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/tests/team.rs

+17
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,23 @@ fn add_team_mixed_case() {
149149
.unwrap();
150150
assert_eq!(krate.owners(&*conn).unwrap().len(), 2);
151151
}
152+
153+
ok_resp!(
154+
middle.call(
155+
req.with_path("/api/v1/crates/foo_mixed_case/owners")
156+
.with_method(Method::Get)
157+
.with_body(body.as_bytes()),
158+
)
159+
);
160+
161+
{
162+
let conn = app.diesel_database.get().unwrap();
163+
let krate = Crate::by_name("foo_mixed_case")
164+
.first::<Crate>(&*conn)
165+
.unwrap();
166+
let owner = &krate.owners(&*conn).unwrap()[1];
167+
assert_eq!(owner.login(), owner.login().to_lowercase());
168+
}
152169
}
153170

154171
// Test adding team as owner when on it

0 commit comments

Comments
 (0)