File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,10 @@ impl<T: Serialize> Serialize for Page<T> {
120
120
// adding the someness of the global alert to the total. `true`
121
121
// is 1 and `false` is 0, so it increments if the value is some (and therefore
122
122
// needs to be serialized)
123
- let mut state =
124
- serializer. serialize_struct ( "Page" , 9 + crate :: GLOBAL_ALERT . is_some ( ) as usize ) ?;
123
+ let mut state = serializer. serialize_struct (
124
+ "Page" ,
125
+ 8 + crate :: GLOBAL_ALERT . is_some ( ) as usize + self . title . is_some ( ) as usize ,
126
+ ) ?;
125
127
126
128
if let Some ( ref title) = self . title {
127
129
state. serialize_field ( "title" , title) ?;
Original file line number Diff line number Diff line change @@ -670,7 +670,7 @@ pub fn build_queue_handler(req: &mut Request) -> IronResult<Response> {
670
670
#[ cfg( test) ]
671
671
mod tests {
672
672
use super :: * ;
673
- use crate :: test:: wrapper;
673
+ use crate :: test:: { assert_success , wrapper} ;
674
674
use serde_json:: json;
675
675
676
676
#[ test]
@@ -1060,4 +1060,12 @@ mod tests {
1060
1060
1061
1061
assert_eq ! ( correct_json, serde_json:: to_value( & release) . unwrap( ) ) ;
1062
1062
}
1063
+
1064
+ #[ test]
1065
+ fn release_feed ( ) {
1066
+ wrapper ( |env| {
1067
+ let web = env. frontend ( ) ;
1068
+ assert_success ( "/releases/feed" , web)
1069
+ } )
1070
+ }
1063
1071
}
Original file line number Diff line number Diff line change 7
7
<link href =" https://pubsubhubbub.appspot.com" rel =" hub" />
8
8
<link href =" https://pubsubhubbub.superfeedr.com" rel =" hub" />
9
9
<id >urn:docs-rs:{{ cratesfyi_version_safe }} </id >
10
- <updated >{{ content [0 ].release_time_rfc3339 }} </updated >
10
+ <updated >{{ content. [0 ].release_time_rfc3339 }} </updated >
11
11
{{ #each content }}
12
12
<entry >
13
13
<title >{{ name }} -{{ version }} </title >
You can’t perform that action at this time.
0 commit comments