Erlang chicago boss error while doing functional tests following the tutorial

53 Views Asked by At

I'm following the tutorial you can find here. I just reached the point in which I'm using the mock database to persist the greetings. I want to write a functional test about the list action, however whenever I try to run the test I get this error:

{"init terminating in do_boot",
 {function_clause,
  [{boss_web_controller_handle_request,
    process_result,
    [{boss_app_info, clvrcrm, [], undefined, undefined,
      undefined, [],
      <0.167.0>, <0.168.0>, <0.219.0>, <0.220.0>,
      ["greeting"],
      ["clvrcrm_view_greeting_list_html",
       "clvrcrm_view_greeting_hello_html",
       "clvrcrm_view_greeting_create_html"],
      ["clvrcrm_greeting_controller"]},
     {sbw, mochiweb_simple_bridge,
      {mochiweb_request,
       [false,[],'GET',"/greeting/list",{1,0},{0,nil}]},
      false,[],[],[],none,[],[],{response,200,[],[],[]}},
     ok],
    [{file,"src/boss/boss_web_controller_handle_request.erl"},
     {line,351}]},
   {boss_web_controller_handle_request,
    process_result_and_add_session,3,
    [{file,"src/boss/boss_web_controller_handle_request.erl"},
     {line,330}]},
   {boss_web_test, get_request_loop,1,
    [{file,"src/boss/boss_web_test.erl"},
     {line,351}]}]}}

This is the code of my test:

-module(clvrcrm_test_list).
-compile(export_all).
start() ->
  boss_web_test:get_request("/greeting/list", [],
  [fun boss_assert:http_ok/1,
   fun (Res) ->
     boss_assert:tag_with_text("li", "No greetings!", Res)
   end
  ], []).

Any idea what's wrong? I highly suspect the db layer isn't configured well for testing, but the config file is the same for production and test, the code in production works well.

0

There are 0 best solutions below