diff --git a/ValidatorTests/ValidatorTests.swift b/ValidatorTests/ValidatorTests.swift index 36f9824..acce060 100644 --- a/ValidatorTests/ValidatorTests.swift +++ b/ValidatorTests/ValidatorTests.swift @@ -44,8 +44,6 @@ class ValidatorTests: XCTestCase { let ERROR_LABEL = UILabel() - let GREEN_COLOR = UIColor.greenColor() - override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. @@ -250,4 +248,13 @@ class ValidatorTests: XCTestCase { XCTAssert(CGColorEqualToColor(self.REGISTER_TXT_FIELD.layer.borderColor, UIColor.redColor().CGColor), "Color should be what it was set as") } } + + func testTextFieldBorderColorNotSet() { + REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()]) + REGISTER_TXT_FIELD.text = INVALID_EMAIL + REGISTER_VALIDATOR.validate { (errors) -> Void in + XCTAssert(errors.count == 1, "Should come back with errors") + XCTAssert(!CGColorEqualToColor(self.REGISTER_TXT_FIELD.layer.borderColor, UIColor.redColor().CGColor), "Color shouldn't get set at all") + } + } }