Can I override task :environment in test_helper.rb to test rake tasks?

后端 未结 3 1507
Happy的楠姐
Happy的楠姐 2021-02-20 14:12

I have a series of rake tasks in a Rakefile which I\'d like to test as part of my specs etc. Each task is defined in the form:

task :do_somthing => :environme         


        
3条回答
  •  逝去的感伤
    2021-02-20 14:27

    when you are running tests environment is that is being loaded is test.

    so you are interacting with test database only.

    So i dont see any reason to override your rake task in test_helper.rb

提交回复
热议问题