diff --git a/test/models/task_test.rb b/test/models/task_test.rb index d88a28ee6..b56644063 100644 --- a/test/models/task_test.rb +++ b/test/models/task_test.rb @@ -360,7 +360,12 @@ def test_ipynb_to_pdf # Test if latex math was rendered properly reader = PDF::Reader.new(task.final_pdf_path) - assert reader.pages.last.text.include?("weight\n") + + # PDF-reader incorrectly parses "weight (kg) / height (m)^2" as "weight (2g) / height (m)", misplacing the ^2 + # Detecting "height" and "weight" confirms correct LaTeX rendering + assert reader.pages.last.text.include?("BMI: bmi =") + assert reader.pages.last.text.include?("weight") + assert reader.pages.last.text.include?("height (m)") # ensure the notice is not included when the notebook doesn't have long lines source code cells # and no errors diff --git a/test_files/submissions/vectorial_graph.ipynb b/test_files/submissions/vectorial_graph.ipynb index 610505cce..fcec0aa6d 100644 --- a/test_files/submissions/vectorial_graph.ipynb +++ b/test_files/submissions/vectorial_graph.ipynb @@ -101,7 +101,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -951,7 +951,7 @@ "source": [ "Formula for calculating\n", "\n", - "BMI: $\\text{bmi}=\\frac{\\text{weight}}{\\text{height}^2}$" + "BMI: $\\text{bmi}=\\frac{\\text{weig}\\text{ht (kg)}}{\\text{hei} \\text{ght (m)}^2}$" ] } ],