Implement commercial calendars: booking_open, specialists, expire without type downgrade.
Refs EventHub/EventHubBack#54
This commit is contained in:
Regular → Executable
+7
-1
@@ -2,7 +2,7 @@
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include("records.hrl").
|
||||
|
||||
-define(TABLES, [user, calendar, event]).
|
||||
-define(TABLES, [user, calendar, event, subscription]).
|
||||
|
||||
setup() ->
|
||||
eh_test_support:start_mnesia(),
|
||||
@@ -50,6 +50,12 @@ create_test_user(Role) ->
|
||||
UserId.
|
||||
|
||||
create_test_calendar(OwnerId, Type, Tags) ->
|
||||
case Type of
|
||||
commercial ->
|
||||
_ = core_subscription:create(OwnerId, monthly, true);
|
||||
_ ->
|
||||
ok
|
||||
end,
|
||||
{ok, Calendar} = core_calendar:create(OwnerId, <<"Test Calendar">>, <<"Description">>, manual),
|
||||
core_calendar:update(Calendar#calendar.id, [{type, Type}, {tags, Tags}]),
|
||||
{ok, Updated} = core_calendar:get_by_id(Calendar#calendar.id),
|
||||
|
||||
Reference in New Issue
Block a user