How do I test helpers in Rails?

后端 未结 5 1555
北海茫月
北海茫月 2021-02-03 18:24

I\'m trying to build some unit tests for testing my Rails helpers, but I can never remember how to access them. Annoying. Suggestions?

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-03 18:55

    I just posted this answer on another thread asking the same question. I did the following in my project.

    require_relative '../../app/helpers/import_helper'
    

提交回复
热议问题