Created
December 23, 2014 04:34
-
-
Save juno/b8051132676f71c147a5 to your computer and use it in GitHub Desktop.
Using rspec-mocks spy. http://journal.sooey.com/254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'Qnyp::Episodes::CalculateEpisodeRatingSummary.process を呼び出す' do | |
user = FactoryGirl.create(:user) | |
# Spyによる監視を行うためには、このようにオブジェクトやメソッドを監視するコードは必要 | |
allow(Qnyp::Episodes::CalculateEpisodeRatingSummary).to receive(:process) | |
get :show | |
expect(Qnyp::Episodes::CalculateEpisodeRatingSummary) | |
.to have_received(:process) | |
.with(user) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment