before do @user = User.first allow(controller) .to receive(:current_user) .and_return(@user) end 説æ controllerã«current_userã®ã¹ã¿ããä½ããã¨ã«ãã£ã¦ãbefore_action require_loginãééã§ãã¾ãã 以ä¸ã§ãã ãã°ã¤ã³æ©è½ãå®éã«çµç±ãã¦æ¬ç©ã®current_userãå¼ã³åºãæ¹æ³ã確ç«ãã¦ããæ¹ãããã£ãããã¾ããããæ¹æ³ãå ±æãã¦é ããã¨å¬ããã§ãã http://stackoverflow.com/questions/5865555/how-to-do-integration-testing-with-rspec-and-devise-cancan http://stackoverflow.com/questions/3720953/rs
{{#tags}}- {{label}}
{{/tags}}