DEV Community

n350071🇯🇵
n350071🇯🇵

Posted on

Search how to use the Factorybot form the project files

🤔 Situation

There is this Factory. You want to make sure how to use the variable 'world' in this project.

factory :hello, class: Hello do
  transient do
    world { 'world' }
  end

👍 Search by Regex

Because the factory name is :hello, it should be

  • create(:hello, blah blah blah, world )
  • build(:hello, blah blah blah, world )

Then, the search word is should be like this.

(create\(:hello.*world)
(build\(:hello.*world)

🔗 Parent Note

Top comments (0)