3 ms·
Thanks for sharing your experience. I think 3) is better now that version 2.0 of Mongoid has been released (and is stable). The developer I am working with com
by gregwebs 15y ago
Thanks for sharing your experience.
I think 3) is better now that version 2.0 of Mongoid has been released (and is stable). The developer I am working with complained about earlier versions also. I ported hundreds of lines of ActiveRecord model code, and it mostly just worked.
I am not really experiencing pain around 1) either. I am using factory girl and find it easy to build any required data. It could actually be beneficial that you must focus on creating a group of properly linked objects. I have run into trouble before with messed up/difficult to create object graphs in ActiveRecord tests.
2) Is a good point I am now mentioning in the post. I will let others argue with you about its severity :)
- ollysb 15y agoI probably need to do some code examples to illustrate the pain points I was experiencing for 1). When I migrated back to ActiveRecord I kept the same model initially and found that I was able to significantly simplify the tests. My main difficulty was with methods that called save on embedded models. I suppose I could have stubbed those calls out but I generally prefer to test the integration with the db. Yeah, I know it's not a pure unit test but I find this is generally the more pragmatic approach. I should say I think mongodb/mongoid can be very useful. My opinion so far though is that it's most effective as a performance optimisation strategy for a stable application.