lambdaclass / holiday_pinger

Erlang + ClojureScript app to send holiday reminders
https://holidaypinger.com
MIT License
69 stars 9 forks source link

Notification #214

Open herdigiorgi opened 6 years ago

herdigiorgi commented 6 years ago

I can't figure out why the test of reminders_SUITE.erl on line 257 fails:

{ok, Channel} = db_channel:get(Email, Name),

test output error:

%%% reminders_SUITE ==> {{badmatch,{ok,200,
               [{<<"server">>,<<"Cowboy">>},
                {<<"date">>,<<"Tue, 30 Jan 2018 15:46:01 GMT">>},
                {<<"content-length">>,<<"2">>},
                {<<"content-type">>,<<"application/json">>}],
               []}},
 [{reminders_SUITE,monthly_limit_enforced,1,
                   [{file,"holiday_ping/_build/test/lib/holiday_ping/test/reminders_SUITE.erl"},
                    {line,257}]},
  {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
  {test_server,run_test_case_eval1,6,[{file,"test_server.erl"},{line,1045}]},
  {test_server,run_test_case_eval,9,[{file,"test_server.erl"},{line,977}]}]}
herdigiorgi commented 6 years ago

Should I try to make remind_router more general, and make a message_router, capable of handle the 3 types of message we currently have? For that i will need to change the db schema.

facundoolano commented 6 years ago

I think you should change the db schema to replace the test boolean for a message type field as discussed. You should also add the send_message function, but don't think you need to rename remind_router or change it's interface other than that (at least don't do it yet, let's see how the code looks after these changes and decide if it needs more refactoring).

unbalancedparentheses commented 6 years ago

@hernanex3 add a better title to the PR