Factory Bot Tutorial for Beginners
Vložit
- čas přidán 8. 05. 2024
- In this AWS + Rails tutorial we cover how to use factory bot for beginners. We start by installing and configuring the factory_bot_rails gem. Next we create our first factory using the factory_bot rails generators and update our spec to accommodate. Finally, we walk through several features of factory_bot including sequences, traits, nested factories and associations.
⏰ Timestamps
0:00 Introduction
0:42 Gem install
1:46 factory_bot config
2:59 Import support files
3:45 Create a factory
4:26 Use new factory
6:34 Run Test Suite
7:16 Using sequence
8:35 Dynamic sequences
9:47 Using Traits
11:08 Nested factories
11:51 Update user factory
13:28 Using associations
15:36 Using with devise create
17:25 Explicit associations
19:08 Push to GitHub
20:28 Closing notes
How to use Git and GitHub for your Rails Application
- • How to use Git and Git...
AWS + Rails Series Playlist
- • AWS + Rails
My Gear List
- brain-trust.io/my-gear
My CZcams SEO Software
- www.tubebuddy.com/braintrust
My Accounting Software
- shareasale.com/r.cfm?b=960179...
Try Audible and Get Two Free Audiobooks
- amzn.to/36dXe3V
Make sure you subscribe to my channel to keep up to date with new content!
DISCLAIMER: Links in this description include affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you! Thank you for supporting BrainTrust Digital so I can continue to provide you with free content each week! - Jak na to + styl
⏰ Timestamps
0:00 Introduction
0:42 Gem install
1:46 factory_bot config
2:59 Import support files
3:45 Create a factory
4:26 Use new factory
6:34 Run Test Suite
7:16 Using sequence
8:35 Dynamic sequences
9:47 Using Traits
11:08 Nested factories
11:51 Update user factory
13:28 Using associations
15:36 Using with devise create
17:25 Explicit associations
19:08 Push to GitHub
20:28 Closing notes
Ur content is always clear and precise. Thank you!
Great video!
Thank you! Let me know if you have any topics you would like me to cover!
great tutorial for factoryBot, Thanks a lottt!!!!!!
So glad you liked it! Please let me know if there are any other topics you would like me to try to cover.
This is a very good video, thank you!
Thank you! Really appreciate the kind words, let me know if there are any other topics you’d like me to cover!
Very helpful! good job!
Thanks, glad I could help! Let me know if you have any other topics you would like me to cover.
@@BrainTrustDigital Can you please cover association with factory bot traits
Great video!... I loved it!!!. I suscribed, thank you! =)
Thank you some much! Glad you enjoyed the video. Do you have any areas around testing in rails you would like me to cover? I feel like there is not enough current content covering this topic.
Nice explanation,
Requesting you to make more rspec videos for testing rails app
Thank you! I’ll see what I can come up with
Interesting material.
I would also like to see content for Sinatra apps as well as an opinion video for ruby's future and rails market in USA :)
+as for ror I would like to see an app using info from an api as apis' consumption is something there is not a lot of content online
Thank you very much
No problem, glad I could help! Let me know if there are other topics you’d like me to cover.
helpful !
Glad I could help!
I could make associated traits work only with the following syntax
trait :moderator do
association :role, factory: :moderator_role
end
what is name of your bash theme
Create is not saving the instance to the database for me . I don't know why , could you help me ? Can I share my code someway
Yes, is this a private or public project? If public, GitHub would be great for sharing.
I fixed it mahn, thanks for the video !!!