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:
Jonathan Bernard
2011-02-04 17:19:53 -06:00
parent 1575e25898
commit 6e2e0d5f00
10 changed files with 164 additions and 78 deletions

26
test/ts_user_tests.erl Normal file
View 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)),