Skip to content

Commit 8c85ca5

Browse files
Nemo157syphar
authored andcommitted
Add test for build page without any builds
1 parent a3465ed commit 8c85ca5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/web/builds.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,31 @@ mod tests {
247247
});
248248
}
249249

250+
#[test]
251+
fn build_empty_list() {
252+
wrapper(|env| {
253+
env.fake_release()
254+
.name("foo")
255+
.version("0.1.0")
256+
.no_builds()
257+
.create()?;
258+
259+
let response = env.frontend().get("/crate/foo/0.1.0/builds").send()?;
260+
assert_cache_control(&response, CachePolicy::NoCaching, &env.config());
261+
let page = kuchikiki::parse_html().one(response.text()?);
262+
263+
let rows: Vec<_> = page
264+
.select("ul > li a.release")
265+
.unwrap()
266+
.map(|row| row.text_contents())
267+
.collect();
268+
269+
assert!(rows.is_empty());
270+
271+
Ok(())
272+
});
273+
}
274+
250275
#[test]
251276
fn limits() {
252277
wrapper(|env| {

0 commit comments

Comments
 (0)