Factory Bot Tutorial for Beginners

Sdílet
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

Komentáře • 26

  • @BrainTrustDigital
    @BrainTrustDigital  Před 3 lety +3

    ⏰ 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

  • @overcomeridemudia3199

    Ur content is always clear and precise. Thank you!

  • @MoBetta42
    @MoBetta42 Před 3 lety +3

    Great video!

    • @BrainTrustDigital
      @BrainTrustDigital  Před 3 lety +2

      Thank you! Let me know if you have any topics you would like me to cover!

  • @CHACHANUS
    @CHACHANUS Před 2 lety +2

    great tutorial for factoryBot, Thanks a lottt!!!!!!

    • @BrainTrustDigital
      @BrainTrustDigital  Před 2 lety

      So glad you liked it! Please let me know if there are any other topics you would like me to try to cover.

  • @matheusribeiro4611
    @matheusribeiro4611 Před 2 lety +1

    This is a very good video, thank you!

    • @BrainTrustDigital
      @BrainTrustDigital  Před 2 lety

      Thank you! Really appreciate the kind words, let me know if there are any other topics you’d like me to cover!

  • @davisnicholas9123
    @davisnicholas9123 Před 2 lety +2

    Very helpful! good job!

    • @BrainTrustDigital
      @BrainTrustDigital  Před 2 lety

      Thanks, glad I could help! Let me know if you have any other topics you would like me to cover.

    • @shivangibansal5406
      @shivangibansal5406 Před 11 měsíci

      @@BrainTrustDigital Can you please cover association with factory bot traits

  • @eonacademy5036
    @eonacademy5036 Před 2 lety +1

    Great video!... I loved it!!!. I suscribed, thank you! =)

    • @BrainTrustDigital
      @BrainTrustDigital  Před 2 lety +1

      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.

  • @riyarb559
    @riyarb559 Před 2 lety +1

    Nice explanation,
    Requesting you to make more rspec videos for testing rails app

  • @alehunter15
    @alehunter15 Před 3 lety

    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 :)

    • @alehunter15
      @alehunter15 Před 3 lety +1

      +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

  • @giauvo3955
    @giauvo3955 Před 2 lety +1

    Thank you very much

    • @BrainTrustDigital
      @BrainTrustDigital  Před 2 lety

      No problem, glad I could help! Let me know if there are other topics you’d like me to cover.

  • @shashankkestwal4454
    @shashankkestwal4454 Před rokem +1

    helpful !

  • @mateobravamateobrava989

    I could make associated traits work only with the following syntax
    trait :moderator do
    association :role, factory: :moderator_role
    end

  • @nejdetkadir4447
    @nejdetkadir4447 Před 2 lety

    what is name of your bash theme

  • @ramanan5185
    @ramanan5185 Před 2 lety +1

    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

    • @BrainTrustDigital
      @BrainTrustDigital  Před 2 lety

      Yes, is this a private or public project? If public, GitHub would be great for sharing.

    • @ramanan5185
      @ramanan5185 Před 2 lety

      I fixed it mahn, thanks for the video !!!