@@ -44,8 +44,10 @@ fn show() {
44
44
45
45
// Create a category and a subcategory
46
46
app. db ( |conn| {
47
- t ! ( new_category( "Foo Bar" , "foo-bar" , "Foo Bar crates" ) . create_or_update( conn) ) ;
48
- t ! ( new_category( "Foo Bar::Baz" , "foo-bar::baz" , "Baz crates" ) . create_or_update( conn) ) ;
47
+ assert_ok ! ( new_category( "Foo Bar" , "foo-bar" , "Foo Bar crates" ) . create_or_update( conn) ) ;
48
+ assert_ok ! (
49
+ new_category( "Foo Bar::Baz" , "foo-bar::baz" , "Baz crates" ) . create_or_update( conn)
50
+ ) ;
49
51
} ) ;
50
52
51
53
// The category and its subcategories should be in the json
@@ -69,8 +71,10 @@ fn update_crate() {
69
71
let user = user. as_model ( ) ;
70
72
71
73
app. db ( |conn| {
72
- t ! ( new_category( "cat1" , "cat1" , "Category 1 crates" ) . create_or_update( conn) ) ;
73
- t ! ( new_category( "Category 2" , "category-2" , "Category 2 crates" ) . create_or_update( conn) ) ;
74
+ assert_ok ! ( new_category( "cat1" , "cat1" , "Category 1 crates" ) . create_or_update( conn) ) ;
75
+ assert_ok ! (
76
+ new_category( "Category 2" , "category-2" , "Category 2 crates" ) . create_or_update( conn)
77
+ ) ;
74
78
let krate = CrateBuilder :: new ( "foo_crate" , user. id ) . expect_build ( & conn) ;
75
79
76
80
// Updating with no categories has no effect
@@ -122,7 +126,7 @@ fn update_crate() {
122
126
assert_eq ! ( count( & anon, "category-2" ) , 0 ) ;
123
127
124
128
// Add a category and its subcategory
125
- t ! ( new_category( "cat1::bar" , "cat1::bar" , "bar crates" ) . create_or_update( conn) ) ;
129
+ assert_ok ! ( new_category( "cat1::bar" , "cat1::bar" , "bar crates" ) . create_or_update( conn) ) ;
126
130
Category :: update_crate ( & conn, & krate, & [ "cat1" , "cat1::bar" ] ) . unwrap ( ) ;
127
131
128
132
assert_eq ! ( count( & anon, "cat1" ) , 1 ) ;
0 commit comments