Skip to content

Commit 2845ce6

Browse files
committed
consistency on tests
1 parent d1b6729 commit 2845ce6

File tree

7 files changed

+30
-22
lines changed

7 files changed

+30
-22
lines changed

tests/resources/BaseIntegrationTest.cfc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,12 @@ component
3131
super.afterAll();
3232
}
3333

34+
/**
35+
* Cleanup for invalid handler on all tests
36+
* @beforeEach
37+
*/
38+
function cleanupInvalidHandler(){
39+
structDelete( request, "_lastInvalidEvent" );
40+
}
41+
3442
}

tests/specs/integration/EventCaching.cfc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
* * renderResults : Render back the results of the event
1616
*******************************************************************************/
1717
component
18-
extends ="coldbox.system.testing.BaseTestCase"
19-
appMapping="/cbTestHarness"
18+
extends="tests.resources.BaseIntegrationTest"
2019
{
2120

2221
/*********************************** LIFE CYCLE Methods ***********************************/

tests/specs/integration/EventExecutions.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* * eventArguments : The struct of args to pass to the event
1515
* * renderResults : Render back the results of the event
1616
*******************************************************************************/
17-
component extends="coldbox.system.testing.BaseTestCase" appMapping="/cbTestHarness" {
17+
component extends="tests.resources.BaseIntegrationTest"{
1818

1919
/*********************************** LIFE CYCLE Methods ***********************************/
2020

tests/specs/integration/MainTests.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
* * renderResults : Render back the results of the event
1616
*******************************************************************************/
1717
component
18-
extends ="coldbox.system.testing.BaseTestCase"
19-
appMapping="/cbTestHarness"
18+
extends="tests.resources.BaseIntegrationTest"
2019
{
2120

2221
/*********************************** LIFE CYCLE Methods ***********************************/
@@ -50,7 +49,8 @@ component
5049

5150
it( "can handle invalid events", function(){
5251
var event = execute( event = "invalid:bogus.index", renderResults = true );
53-
expect( event.getValue( "cbox_rendered_content" ) ).toBe( "<h1>Invalid Page</h1>" );
52+
expect( event.getValue( "cbox_rendered_content" ) ).toBe( "<h1>Invalid Page</h1>
53+
" );
5454
} );
5555

5656
it( "can handle invalid onInvalidEvent handlers", function(){

tests/specs/integration/ModuleTests.cfc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
* * eventArguments : The struct of args to pass to the event
1515
* * renderResults : Render back the results of the event
1616
*******************************************************************************/
17-
component
18-
extends ="coldbox.system.testing.BaseTestCase"
19-
appMapping="/cbTestHarness"
20-
{
17+
component extends="tests.resources.BaseIntegrationTest" {
2118

2219
/*********************************** LIFE CYCLE Methods ***********************************/
2320

@@ -92,7 +89,9 @@ component
9289
expect( config ).toHaveKey( "test1" );
9390
expect( config[ "test1" ] ).toHaveKey( "settings" );
9491

95-
expect( config[ "test1" ].settings ).toBe( parentSettings.moduleSettings[ "test1" ] );
92+
expect( config[ "test1" ].settings ).toBe(
93+
parentSettings.moduleSettings[ "test1" ]
94+
);
9695

9796
expect( parentSettings ).toHaveKey( "test1" );
9897
expect( parentSettings[ "test1" ] ).notToBe( config[ "test1" ].settings );
@@ -148,7 +147,10 @@ component
148147
story( "Modules can register application helpers", function(){
149148
given( "application helpers directive", function(){
150149
then( "the module service will load them by convention", function(){
151-
var event = execute( event = "conventionsTest:test.index", renderResults = true );
150+
var event = execute(
151+
event = "conventionsTest:test.index",
152+
renderResults = true
153+
);
152154
expect( event.getRenderedContent() ).toInclude( "hello from module app helper" );
153155
} );
154156
} );

tests/specs/integration/RestfulHandlersTests.cfc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
* * eventArguments : The struct of args to pass to the event
1515
* * renderResults : Render back the results of the event
1616
*******************************************************************************/
17-
component
18-
extends="tests.resources.BaseIntegrationTest"
19-
{
17+
component extends="tests.resources.BaseIntegrationTest" {
2018

2119
function beforeAll(){
2220
super.beforeAll();

tests/specs/integration/WireBoxDSLTests.cfc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/*******************************************************************************
22
* Test for custom WireBox DSLs
33
*******************************************************************************/
4-
component
5-
extends ="coldbox.system.testing.BaseTestCase"
6-
appMapping="/cbTestHarness"
7-
{
4+
component extends="tests.resources.BaseIntegrationTest" {
85

96
/*********************************** LIFE CYCLE Methods ***********************************/
107

@@ -28,8 +25,10 @@ component
2825

2926
it( "can handle box setting namespace", function(){
3027
// box namespace === coldbox namespace
31-
var coldboxresult = controller.getWirebox().getInstance( dsl = "coldbox:setting:appName" );
32-
var boxresult = controller.getWirebox().getInstance( dsl = "box:setting:appName" );
28+
var coldboxresult = controller
29+
.getWirebox()
30+
.getInstance( dsl = "coldbox:setting:appName" );
31+
var boxresult = controller.getWirebox().getInstance( dsl = "box:setting:appName" );
3332

3433
expect( boxresult ).toBe( coldboxresult );
3534
} );
@@ -49,7 +48,9 @@ component
4948
} );
5049

5150
it( "can handle 3 stage configSettings namespace", function(){
52-
var result = controller.getWirebox().getInstance( dsl = "box:configSettings:appName" );
51+
var result = controller
52+
.getWirebox()
53+
.getInstance( dsl = "box:configSettings:appName" );
5354

5455
expect( result ).toBeString();
5556
} );

0 commit comments

Comments
 (0)