1
私application_controllerこれはUserオブジェクトを返します方法ヘルプ
def current_user
end
を持っています。今RSpecのを使用して
、私はだから私はapplication_helper
でtest_this_method
をテストしたいapplication_helper.rb
def test_this_method(some_object)
..
.. = some_other_method(current_user)
end
def some_other_method
..
user.age
user.height
end
でヘルパーをテストしています。
B ** utはsome_other_methodを呼び出すので、これはスタブ/モックされなければなりません。また、current_userオブジェクトも参照されているので、mockされなければなりません。**
どうすればいいですか?