Sabtu, 07 April 2012

RSpec. How to check if the object method is called?

I'm writing the spec for controller: it 'should call the method that performs the movies search' do movie = Movie.new movie.should_receive(:search_similar) get :find_similar, {:id => '1'} end and my controller looks like: def find_similar @movies = Movie.find(params[:id]).search_similar end after running the rspec i get the following: Failures: 1) MoviesController searching by

0 comments:

Posting Komentar