Redesigned API URL structure. Updated ts_api to implement this.
Implemented ts_api:list_timelines/2. Adjusted ts_timeline:list/3 to be 0-indexed. Changed ts_user password hash to use a random salt + SHA1 Added some skeleton testing code.
This commit is contained in:
26
test/ts_user_tests.erl
Normal file
26
test/ts_user_tests.erl
Normal file
@ -0,0 +1,26 @@
|
||||
-module(ts_user_tests).
|
||||
%-import(ts_test_common, [assertRecordsEqual/2]).
|
||||
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("../src/ts_db_records.hrl").
|
||||
|
||||
setup() -> ts_test_env:setup().
|
||||
|
||||
cleanup(_Status) -> ts_api_env:cleanup(ok).
|
||||
|
||||
% ======== TEST DATA ======== %
|
||||
|
||||
joe_user() -> #ts_user{username=joeuser, name="Joe User", pwd="ohmy",
|
||||
email="JoeUser@users.org",
|
||||
join_date=calendar:now_to_datetime(erlang:now())}.
|
||||
|
||||
% ======== TESTS ======== %
|
||||
|
||||
new_delete_test_() ->
|
||||
% test data
|
||||
JoeUser = joe_user(),
|
||||
|
||||
{setup, fun setup/0, fun cleanup/1, {inorder, [
|
||||
?_test(new(JoeUser)),
|
||||
?_test(lookup(JoeUser#ts_user.username, JoeUser)),
|
||||
|
Reference in New Issue
Block a user