Skip to content

Commit

Permalink
Repair unit tests. Was broken after introducing the template logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Sep 9, 2010
1 parent e4ecb72 commit 7ea8428
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/support/z_context.erl
Expand Up @@ -141,7 +141,7 @@ new(ReqData, Module) ->

% @doc Create a new context used when testing parts of zotonic
new_tests() ->
z_trans_server:set_context_table(#context{host=test, language=en}).
z_trans_server:set_context_table(#context{host=test, language=en, notifier='z_notifier$test'}).


%% @doc Set the dispatch rule for this request to the context var 'zotonic_dispatch'
Expand Down
7 changes: 7 additions & 0 deletions src/support/z_notifier.erl
Expand Up @@ -30,6 +30,7 @@

%% interface functions
-export([
start_tests/0,
observe/3,
observe/4,
detach/3,
Expand Down Expand Up @@ -63,6 +64,12 @@ start_link(SiteProps) when is_list(SiteProps) ->
gen_server:start_link({local, Name}, ?MODULE, SiteProps, []).


%% @doc Start a notifier server for unit testing
start_tests() ->
io:format("Starting notifier server.~n"),
gen_server:start_link({local, 'z_notifier$test'}, ?MODULE, [], []).


%%====================================================================
%% API for subscription
%%====================================================================
Expand Down
1 change: 1 addition & 0 deletions src/tests/erlydtl/erlydtl_tests_init.erl
Expand Up @@ -4,4 +4,5 @@

init() ->
z_trans_server:start_tests(),
z_notifier:start_tests(),
z_ids:start_tests().

0 comments on commit 7ea8428

Please sign in to comment.