モジュールがインクルードされているか it "should include AuthenticatedSystem" do controller.class.included_modules.should include(AuthenticatedSystem) end 隠したいパラメータがフィルターされているか it "should filter credit_cards" do controller.send(:filter_parameters, 'credit_card' => 'nogood')\ ['credit_card'].should == '[FILTERED]' end Before filters it "should have a before_filter for login_required" do controller.class.before_filter
![rspecでコントローラのテストを書くときのTips | GENDOSU@NET](https://cdn-ak-scissors.b.st-hatena.com/image/square/31cf84cda6a253c0e1b3496f0e315bcafe8223ae/height=288;version=1;width=512/https%3A%2F%2Fgendosu.jp%2Fwp-content%2Fuploads%2F2016%2F03%2Fgendosu-logo-img.png)