Details
Description
Generated testSave() and testUpdate() fail, apparently because 'save' action fails in generated controller when running in unit test.
1. Create new grails project in STS, with one new domain class (org.example. Thing)
2. Generate Controller for org.example.Thing
3. 'test-app' and get:
| Failure: testSave(org.example.ThingControllerTests) |
| Assertion failed: |
assert model.thingInstance != null
[:] null false
at org.example.ThingControllerTests.testSave(ThingControllerTests.groovy:47)
...
| Failure: testUpdate(org.example.ThingControllerTests) |
| Assertion failed: |
assert view == "/thing/edit"
null false
at org.example.ThingControllerTests.testUpdate(ThingControllerTests.groovy:124)
Activity
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | master | 15b8ee3... | 2011-11-15 04:29:05 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | hibernate4 | 15b8ee3... | 2011-11-15 04:29:05 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.1.x | 15b8ee3... | 2011-11-15 04:29:05 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.2.x | 15b8ee3... | 2011-11-15 04:29:05 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.0.x | 9b0bdd6... | 2011-11-15 05:26:03 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | grails_2.0.x | 9b0bdd6... | 2011-11-15 05:26:03 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.1.x | 9b0bdd6... | 2011-11-15 05:26:03 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | 2.2.x | 9b0bdd6... | 2011-11-15 05:26:03 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |
| Repository | Branch | Revision | Date | Author/Committer | Message |
| Grails Core | master | 9b0bdd6... | 2011-11-15 05:26:03 -0800 | Jeff Brown / Jeff Brown | In a unit test which mocks a domain class with @Mock, if a domain object has binding errors associated with it before it is validated the binding error will be lost if no validation errors occur. This change addresses that. |
| Files Changed | |||||
|
MODIFY
grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
ADD grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy |