Skip to content

Commit

Permalink
Refactoring rendering tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Keats committed Mar 3, 2022
1 parent dde3531 commit 40d7208
Show file tree
Hide file tree
Showing 81 changed files with 2,150 additions and 3,793 deletions.
379 changes: 242 additions & 137 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions components/library/src/taxonomies/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,8 @@ impl Taxonomy {

// Check for taxon-specific template, or use generic as fallback.
let specific_template = format!("{}/single.html", self.kind.name);
let template = if let Some(template) =
check_template_fallbacks(&specific_template, tera, &config.theme)
{
template
} else {
"taxonomy_single.html"
};
let template = check_template_fallbacks(&specific_template, tera, &config.theme)
.unwrap_or("taxonomy_single.html");

render_template(template, tera, context, &config.theme).map_err(|e| {
Error::chain(format!("Failed to render single term {} page.", self.kind.name), e)
Expand Down
2 changes: 1 addition & 1 deletion components/rendering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ libs = { path = "../libs" }

[dev-dependencies]
templates = { path = "../templates" }

insta = "1.12.0"
6 changes: 3 additions & 3 deletions components/rendering/src/shortcode/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ mod tests {
fn can_handle_multiple_shortcodes() {
let (_, shortcodes) = parse_for_shortcodes(
r#"
{{ youtube(id="ub36ffWAqgQ") }}
{{ youtube(id="ub36ffWAqgQ_hey_") }}
{{ youtube(id="ub36ffWAqgQ", autoplay=true) }}
{{ vimeo(id="210073083") }}
{{ streamable(id="c0ic") }}
{{ vimeo(id="210073083#hello", n_a_me="hello") }}
{{ streamable(id="c0ic", n1=true) }}
{{ gist(url="https://gist.github.com/Keats/32d26f699dcc13ebd41b") }}"#,
)
.unwrap();
Expand Down
56 changes: 0 additions & 56 deletions components/rendering/tests/codeblock_hide_lines.rs

This file was deleted.

Loading

0 comments on commit 40d7208

Please sign in to comment.