File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use crate::views::EncodablePublicUser;
9
9
pub fn show ( req : & mut dyn Request ) -> AppResult < Response > {
10
10
use self :: users:: dsl:: { gh_login, id, users} ;
11
11
12
- let name = & req. params ( ) [ "user_id" ] . to_lowercase ( ) ;
12
+ let name = crate :: lower ( & req. params ( ) [ "user_id" ] ) ;
13
13
let conn = req. db_conn ( ) ?;
14
14
let user = users
15
15
. filter ( crate :: lower ( gh_login) . eq ( name) )
Original file line number Diff line number Diff line change @@ -142,14 +142,14 @@ fn me() {
142
142
#[ test]
143
143
fn show ( ) {
144
144
let ( app, anon, _) = TestApp :: init ( ) . with_user ( ) ;
145
- app. db_new_user ( "bar " ) ;
145
+ app. db_new_user ( "Bar " ) ;
146
146
147
147
let json: UserShowPublicResponse = anon. get ( "/api/v1/users/foo" ) . good ( ) ;
148
148
assert_eq ! ( "foo" , json. user. login) ;
149
149
150
- let json: UserShowPublicResponse = anon. get ( "/api/v1/users/bar " ) . good ( ) ;
151
- assert_eq ! ( "bar " , json. user. login) ;
152
- assert_eq ! ( Some ( "https://github.com/bar " . into( ) ) , json. user. url) ;
150
+ let json: UserShowPublicResponse = anon. get ( "/api/v1/users/bAr " ) . good ( ) ;
151
+ assert_eq ! ( "Bar " , json. user. login) ;
152
+ assert_eq ! ( Some ( "https://github.com/Bar " . into( ) ) , json. user. url) ;
153
153
}
154
154
155
155
#[ test]
You can’t perform that action at this time.
0 commit comments