rspec test of my controller returns nil (+factory girl)

前端 未结 1 1619
别那么骄傲
别那么骄傲 2021-01-15 03:02

I am learning tests with rspec and factory girl on Rails and I can\'t manage to make them work.

My User controller looks like this :

class UsersCont         


        
1条回答
  •  被撕碎了的回忆
    2021-01-15 03:23

    As Jvnill said above, use create. The other option is to use @user1.save after declaring them.

    Also as far as routes go, check your resources in the routes file.

    0 讨论(0)
提交回复
热议问题