title: Phoenix/Elixir test view helpers
body: <p>I have created a helper to do some calculations before a number is presented to the view:</p>
  <pre><code>defmodule FourtyWeb.CalculationHelpers do
  
    use Phoenix.HTML
  
    def value_in_euro(amount_in_cents) when is_binary(amount_in_cents) do
      cond do
        # some code
      end
    end
  
  end
  </code></pre>
  <p>This thing works. I am now trying to test it:</p>
  <pre><code>defmodule FourtyWeb.CalculationHelpersTest do
    use FourtyWeb.ConnCase, async: true
    
    import Phoenix.View
  
    @amount_in_cents 1020
  
    describe &quot;it calculates the correct value in euro&quot; do
       test &quot;with correct data&quot; do
         assert 10.20 == value_in_euro(@amount_in_cents)
       end
     end
  
  end
  </code></pre>
  <p>If I run mix test I get the following error and I can't figure out why:</p>
  <pre><code>== Compilation error in file test/app_web/views/calculation_helpers_test.exs ==
  ** (CompileError) test/fourty_web/views/calculation_helpers_test.exs:11: undefined function value_in_euro/1
  </code></pre>
  <p>Can anyone elaborate?</p>