How to run Rails console in the test environment and load test_helper.rb?

后端 未结 10 687
梦如初夏
梦如初夏 2020-12-12 19:58

The background: I\'m having some problems with Thoughtbot\'s \"Factory Girl\" gem, with is used to create objects to use in unit and other tests. I\'d like to go to the cons

10条回答
  •  一个人的身影
    2020-12-12 20:38

    You can specify the environment in which the console command should operate.

    rails c [environment]
    

    Examples

    1) For Staging

    rails c staging
    

    2) For Production

    rails c production
    

    For source & detailed description: The Rails Command Line

提交回复
热议问题