File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1367,4 +1367,38 @@ feed_filenames = ["rss.xml"]
1367
1367
assert ! ( !std:: fs:: read_to_string( public_dir. join( "fr" ) . join( "rss.xml" ) ) . unwrap( ) . contains( "My En Article" ) ) ;
1368
1368
assert ! ( std:: fs:: read_to_string( public_dir. join( "fr" ) . join( "rss.xml" ) ) . unwrap( ) . contains( "My Fr Article" ) ) ;
1369
1369
}
1370
+
1371
+ #[ test]
1372
+ fn can_render_feed_for_multi_language_with_language_level_feed_flag_preferred_for_default ( ) {
1373
+ let config_raw = r#"
1374
+ base_url = "https://replace-this-with-your-url.com"
1375
+ default_language = "en"
1376
+ generate_feeds = false
1377
+
1378
+ [languages.en]
1379
+ title = "My English site"
1380
+ generate_feeds = true
1381
+
1382
+ [languages.fr]
1383
+ title = "My French site"
1384
+ generate_feeds = true
1385
+
1386
+ "# ;
1387
+ let pages = vec ! [
1388
+ ( "My En Article" , "content/my-article.md" , "en" ) ,
1389
+ ( "My Fr Article" , "content/my-article.fr.md" , "fr" ) ,
1390
+ ] ;
1391
+
1392
+ let ( tmp_dir, site) = create_site_from_config_and_pages ( config_raw, & pages) ;
1393
+ let public_dir = site. output_path ;
1394
+
1395
+ assert ! ( tmp_dir. path( ) . exists( ) ) ;
1396
+ assert ! ( public_dir. exists( ) ) ;
1397
+ assert ! ( public_dir. join( "atom.xml" ) . exists( ) ) ;
1398
+ assert ! ( public_dir. join( "fr" ) . join( "atom.xml" ) . exists( ) ) ;
1399
+ assert ! ( std:: fs:: read_to_string( public_dir. join( "atom.xml" ) ) . unwrap( ) . contains( "My En Article" ) ) ;
1400
+ assert ! ( !std:: fs:: read_to_string( public_dir. join( "atom.xml" ) ) . unwrap( ) . contains( "My Fr Article" ) ) ;
1401
+ assert ! ( !std:: fs:: read_to_string( public_dir. join( "fr" ) . join( "atom.xml" ) ) . unwrap( ) . contains( "My En Article" ) ) ;
1402
+ assert ! ( std:: fs:: read_to_string( public_dir. join( "fr" ) . join( "atom.xml" ) ) . unwrap( ) . contains( "My Fr Article" ) ) ;
1403
+ }
1370
1404
}
You can’t perform that action at this time.
0 commit comments