“Could not find a valid mapping for #” only on second and successive tests

后端 未结 9 1965
花落未央
花落未央 2020-12-28 13:28

I\'m trying to write a request test that asserts that the proper links appear on the application layout depending in whether a user is logged in or out. FWIW, I\'m using Dev

9条回答
  •  感情败类
    2020-12-28 14:11

    In my case this was a problem with Devis's confirm! method. So instead of doing this (Minitest::Test code):

    setup do
      @admin = create(:admin).confirm!
    end
    

    I have done this:

    setup do
      @admin = create(:admin)
      @admin.confirm!
    end
    

    And it worked :)

提交回复
热议问题