Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply cfformat changes
  • Loading branch information
elpete authored and actions-user committed Feb 16, 2022
commit 4ef74ce1fd8fb36806fba15d697174f1804df233
2 changes: 1 addition & 1 deletion models/validators/EmptyValidator.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ component extends="BaseValidator" accessors="true" singleton {
);
}

// return true if no data to check, empty needs a data element to be checked.
// return true if no data to check, empty needs a data element to be checked.
if ( isNull( arguments.targetValue ) ) {
return true;
}
Expand Down
14 changes: 11 additions & 3 deletions test-harness/tests/specs/validators/EmptyValidatorTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ component extends="coldbox.system.testing.BaseModelTest" model="cbvalidation.mod
variables.result = createMock( "cbvalidation.models.result.ValidationResult" ).init();
} );

it( "skips over null values", function() {
expect( model.validate( variables.result, this, "test", javacast( "null", "" ), true ) ).toBeTrue();
} );
it( "skips over null values", function(){
expect(
model.validate(
variables.result,
this,
"test",
javacast( "null", "" ),
true
)
).toBeTrue();
} );

describe( "empty: true", function(){
it( "passes when given an empty string", function(){
Expand Down