2016-02-10 69 views
1

我在我的应用程序的ApplicationController中定义了一个名为auth_user的小方法。我在SessionController中将其设置为before_action如何在父控制器中定义一个方法?

如何从SessionController测试中找出auth_user方法?

编辑:我使用MINITEST

回答

1

它最有可能的应该是SessionsController(复数),但不是在这里很重要。

allow_any_instance_of(SessionController).to receive(:auth_user).and_return(user) 
相关问题