Install Factory Bot with Ruby on Rails

Тәжірибелік нұсқаулар және стиль

In this episode, you'll learn how to setup the factory_bot_rails gem and some basics about using factories with RSpec tests in a Ruby on Rails application.
#rails #rubyonrails

Пікірлер: 12

  • @subem81
    @subem81 Жыл бұрын

    Wow CJ. Thank you so much for this series! Rails doesn't get enough love and your content is truly a pillar for me. Thank you!

  • @dhrusoni1
    @dhrusoni12 жыл бұрын

    Clear understanding on the factory bot. Thank you Can you create how the traits, associations work with it with the next episode. Waiting for the next demo.

  • @cjav_dev

    @cjav_dev

    2 жыл бұрын

    I definitely want to dive deeper in factory bot. It’ll be at least a few weeks before I get to this tho!

  • @qonaahnurussalamah7098
    @qonaahnurussalamah70982 жыл бұрын

    Well explained, super helpful. Thankyou!

  • @tuchandra1729
    @tuchandra1729 Жыл бұрын

    Thank you for content 🎉

  • @user-ki6cb6en9d
    @user-ki6cb6en9d10 ай бұрын

    Thank you so much :)

  • @Cabugamer
    @CabugamerАй бұрын

    Your videos are amazing, but something that I'm really jealous of is your control of Vim...

  • @haroldpepete
    @haroldpepete Жыл бұрын

    can you do a video about has_and_belongs_to_many in factorybot?

  • @CHACHANUS
    @CHACHANUS2 жыл бұрын

    Excellent video ... A question.. how can I create a hash with factory...with traits to add additional attributes to principal factory hash..is that possible?

  • @cjav_dev

    @cjav_dev

    2 жыл бұрын

    Thanks Pierre! I believe the factories with factory bot only return instances of those underlying models. I would likely create a custom HashFactory class that doesn't use factory bot, but instead exposes a class method `create` that allows you to pass in your own override properties. Perhaps even a making HashFactory the parent of some other sub classes like CarHashFactory < HashFactory or similar.

  • @CHACHANUS

    @CHACHANUS

    2 жыл бұрын

    @@cjav_dev ah ok.. thanks a lot...

  • @AlainPilon
    @AlainPilon11 ай бұрын

    How do you handle a situation where you have a model with a very deep belongs_to association tree. In my case, the tree is 12 level deep and if I dont provide the belongs_to associated model in the factory, I get the ActiveRecord::RecordInvalid: Validation failed: XXXX must exist.