title: RoR - rspec tests failing and shouldn't
body: <p>I'm running these rspec tests for my controller:</p>
  
  <pre><code>require 'spec_helper'
  
  describe MoviesController do
    describe 'searching for similar movies' do
      before :each do 
        @fake_movies = [mock('Movie'), mock('Movie')]
        @fake_movie = FactoryGirl.build(:movie, :id =&gt; "1", :title =&gt; "Star Wars", :director =&gt; "George Lucas") 
      end
      it 'should follow the route to the similar movies by director page' do
        assert_routing('movies/1/similar', {:controller =&gt; 'movies', :action =&gt; 'similar', :id =&gt; '1'}) 
      end
  
      it 'should find the similar movies by director' do
        Movie.should_receive(:find_by_id).with("1").and_return(@fake_movie)
        Movie.should_receive(:find_by_director).with(@fake_movie.director).and_return(@fake_movies)
        get :similar, {:id =&gt; "1"}
      end
  
      it 'should select the Similiar Movies template for rendering' do
        Movie.should_receive(:find_by_id).with("1").and_return(@fake_movie)
        Movie.should_receive(:find_by_director).with(@fake_movie.director).and_return(@fake_movies)
        get :similar, {:id =&gt; "1"}
        response.should render_template('similar')
      end
  
      it 'it should make the results available to the template' do
        Movie.should_receive(:find_by_id).with("1").and_return(@fake_movie)
        Movie.should_receive(:find_by_director).with(@fake_movie.director).and_return(@fake_movies)
        get :similar, {:id =&gt; "1"}
        assigns(:movies).should == @fake_results
      end
    end
  end
  </code></pre>
  
  <p>Buy they are failing with this output:</p>
  
  <pre><code>    Failures:
  
    1) MoviesController searching for similar movies should find the similar movies by director
       Failure/Error: get :similar, {:id =&gt; "1"}
         &lt;Movie(id: integer, title: string, rating: string, description: text, release_date: datetime, created_at: datetime, updated_at: datetime, director: string) (class)&gt; received :find_by_director with unexpected arguments
           expected: ("George Lucas")
                got: ()
       # ./app/controllers/movies_controller.rb:62:in `similar'
       # ./spec/controllers/movies_controller_spec.rb:17:in `block (3 levels) in &lt;top (required)&gt;'
  
    2) MoviesController searching for similar movies should select the Similiar Movies template for rendering
       Failure/Error: get :similar, {:id =&gt; "1"}
         &lt;Movie(id: integer, title: string, rating: string, description: text, release_date: datetime, created_at: datetime, updated_at: datetime, director: string) (class)&gt; received :find_by_director with unexpected arguments
           expected: ("George Lucas")
                got: ()
       # ./app/controllers/movies_controller.rb:62:in `similar'
       # ./spec/controllers/movies_controller_spec.rb:23:in `block (3 levels) in &lt;top (required)&gt;'
  
    3) MoviesController searching for similar movies it should make the results available to the template
       Failure/Error: get :similar, {:id =&gt; "1"}
         &lt;Movie(id: integer, title: string, rating: string, description: text, release_date: datetime, created_at: datetime, updated_at: datetime, director: string) (class)&gt; received :find_by_director with unexpected arguments
           expected: ("George Lucas")
                got: ()
       # ./app/controllers/movies_controller.rb:62:in `similar'
       # ./spec/controllers/movies_controller_spec.rb:30:in `block (3 levels) in &lt;top (required)&gt;'
  
  Finished in 0.15517 seconds
  4 examples, 3 failures
  
  Failed examples:
  
  rspec ./spec/controllers/movies_controller_spec.rb:14 # MoviesController searching for similar movies should find the similar movies by director
  rspec ./spec/controllers/movies_controller_spec.rb:20 # MoviesController searching for similar movies should select the Similiar Movies template for rendering
  rspec ./spec/controllers/movies_controller_spec.rb:27 # MoviesController searching for similar movies it should make the results available to the template
  </code></pre>
  
  <p>When this is my controller method:</p>
  
  <pre><code>def similar 
      @movies = Movie.find_by_director(Movie.find_by_id(params[:id]))
    end
  </code></pre>
  
  <p>I do not understand why these tests are failing.</p>