You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I worte following Integration test code. comments explain this problem.
defsample () {
setup:
assertRoomType.count ==0// it will be "0". no problem.RoomType roomType1 =RoomType.build(save: false)
assert roomType1.id ==null// no problem.assertRoomType.count ==0// this test fails... RoomType.count returns "1"
}
so, Grails's test report shows such as following message.
Condition not satisfied:
RoomType.count ==0// this test fails... RoomType.count returns "1"
| |
1false
I think that the following actions are originally correct:
RomoType.build(save: false) creates a instance of RoomType domain of Grails.
But not save into data store(I use H2 for Integration test), because be specified save: false in build method.
However, like a above my sample code, that instance saves immediately.
Is this behavior correct? or i understand it wrong?
The text was updated successfully, but these errors were encountered:
koji-k
changed the title
"Domain.build(svae:false)" saves immediately
"Domain.build(save:false)" saves immediately
Oct 16, 2018
Hi,
I use Grails
3.3.8
andbuild-test-data:3.3.1
I worte following Integration test code. comments explain this problem.
so, Grails's test report shows such as following message.
I think that the following actions are originally correct:
RomoType.build(save: false)
creates a instance of RoomType domain of Grails.save: false
in build method.However, like a above my sample code, that instance saves immediately.
Is this behavior correct? or i understand it wrong?
The text was updated successfully, but these errors were encountered: