Skip to content
Permalink
Browse files

fix tests

  • Loading branch information...
DominicWatson committed Oct 21, 2019
1 parent d5d8bc7 commit 4986a73337cb30858dbc270a14151ecbe344c094
@@ -173,7 +173,7 @@ component extends="testbox.system.BaseSpec" {

mockTaskDao.$( "insertData" ).$args( {
event = event
, event_args = SerializeJson( args )
, event_args = SerializeJson( _addMockRequestState( args ) )
, admin_owner = owner
, web_owner = ""
, discard_on_complete = false
@@ -201,7 +201,7 @@ component extends="testbox.system.BaseSpec" {

mockTaskDao.$( "insertData" ).$args( {
event = event
, event_args = SerializeJson( args )
, event_args = SerializeJson( _addMockRequestState( args ) )
, admin_owner = ""
, web_owner = owner
, discard_on_complete = true
@@ -241,7 +241,7 @@ component extends="testbox.system.BaseSpec" {

mockTaskDao.$( "insertData" ).$args( {
event = event
, event_args = SerializeJson( args )
, event_args = SerializeJson( _addMockRequestState( args ) )
, admin_owner = owner
, web_owner = ""
, discard_on_complete = false
@@ -279,7 +279,7 @@ component extends="testbox.system.BaseSpec" {

mockTaskDao.$( "insertData" ).$args( {
event = event
, event_args = SerializeJson( args )
, event_args = SerializeJson( _addMockRequestState( args ) )
, admin_owner = ""
, web_owner = ""
, discard_on_complete = false
@@ -307,7 +307,7 @@ component extends="testbox.system.BaseSpec" {

mockTaskDao.$( "insertData" ).$args( {
event = event
, event_args = SerializeJson( args )
, event_args = SerializeJson( _addMockRequestState( args ) )
, admin_owner = ""
, web_owner = ""
, discard_on_complete = false
@@ -337,7 +337,7 @@ component extends="testbox.system.BaseSpec" {

mockTaskDao.$( "insertData" ).$args( {
event = event
, event_args = SerializeJson( args )
, event_args = SerializeJson( _addMockRequestState( args ) )
, admin_owner = ""
, web_owner = owner
, discard_on_complete = true
@@ -751,12 +751,15 @@ component extends="testbox.system.BaseSpec" {
) );

mockRequestContext.$( "setUseQueryCache" );
mockRequestContext.$( "getSiteId", "mock-site-id" );
mockRequestContext.$( "getLanguage", "mock-language" );

service.$( "$getPresideObject" ).$args( "taskmanager_adhoc_task" ).$results( mockTaskDao );
service.$( "$getColdbox", mockColdbox );
service.$( "$getRequestContext", mockRequestContext );
service.$( "$isFeatureEnabled" ).$args( "sslInternalHttpCalls" ).$results( true );
service.$( "_now", nowish );
service.$( "_setRequestState" );

return service;
}
@@ -781,4 +784,13 @@ component extends="testbox.system.BaseSpec" {

return dummyObj;
}

private struct function _addMockRequestState( struct args ){
args.__requestState = {
site = "mock-site-id"
, language = "mock-language"
};

return args;
}
}
@@ -672,6 +672,7 @@ component extends="testbox.system.BaseSpec" {
tm.$( "$getRequestContext", mockRc );
tm.$( "$getErrorLogService", mockErrorLogService );
tm.$( "$isFeatureEnabled" ).$args( "sslInternalHttpCalls" ).$results( true );
tm.$( "_setActiveSite" );
mockRc.$( "setUseQueryCache" );

return tm.init(

0 comments on commit 4986a73

Please sign in to comment.
You can’t perform that action at this time.