title: Really weird problem about getting a rspec controller test to pass where the code is correct
body: <p>I have a weird problem where I know the code works, the RSpec test will pass if I run that Spec file by itself, but it fails when I run all the tests in the entire suite (everything in /specs).</p>
  
  <p>Here is the test:</p>
  
  <pre><code>require 'spec_helper'
  
  describe WebpagesController do
    include Devise::TestHelpers
  
    render_views
  
    describe "GET 'show'" do
      it "should render the template if it exists" do
        get 'show', :page =&gt; "tour"
  
        response.should render_template("tour")
      end
  
      it "should render 404 page if template does not exist" do
        expect {
          get 'show', :page =&gt; 'does_not_exist'
        }.to_not raise_error(ActionView::MissingTemplate)
  
        response.should render_template("/public/404")
      end
    end
  
  end
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>class WebpagesController &lt; ApplicationController
  
    def show
      begin
        render(params[:page])
      rescue ActionView::MissingTemplate
        render("/public/404")
      end
    end
  
  end
  </code></pre>
  
  <p>The idea here is that the 'show' action should render the template with whatever name is given by the parameter, but if it doesn't exist, we want to send the user to the generic 404 page.</p>
  
  <p>Now, I could just duplicate the 404 template in the /webpages view directory, but I really want to figure out how I can get this to pass using the one provided in the /public folder like I am trying to do here.</p>
  
  <p>If I run the test in isolation - it PASSES. If I run the test with all the others, I get the following error:</p>
  
  <pre><code>expected no ActionView::MissingTemplate, got #&lt;ActionView::MissingTemplate: Missing template /public/404 with {:handlers=&gt;[:erb, :rjs, :builder, :rhtml, :rxml], :formats=&gt;[:html], :locale=&gt;[:en, :en]} in view paths "/home/egervari/Projects/training/app/views", "/usr/local/lib/ruby/gems/1.9.1/gems/devise-1.3.4/app/views", "/home/egervari/Projects/training/spec", "/"&gt;
  /usr/local/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/expectations/fail_with.rb:29:in `fail_with'
  /usr/local/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/expectations/handler.rb:44:in `handle_matcher'
  /usr/local/lib/ruby/gems/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/expectations/extensions/kernel.rb:50:in `should_not'
  /home/egervari/Projects/training/spec/controllers/webpages_controller_spec.rb:17:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>I've honestly been stumped with this one for several days, and I've just been working on other stuff... but I am a little annoyed to see 1 test failing all the time even though I personally know it's fine.</p>
  
  <p>Thanks for the help</p>