title: Rspec testing of flash messages
body: <p>I am having issues getting my specs to work with the following:</p>
  
  <p>Inside of my IntegrationController:</p>
  
  <pre><code>def check_jira_url
      if params[:user][:jira_url] == ""
        flash[:error] = "Please enter your JIRA application URL. It should start with http:// or https://"
        render check_jira_group_plan_path
      elsif params[:user][:jira_url][0,4] != "http"
        flash[:error] = "Bad JIRA path. Please correct your JIRA application URL. It should start with http:// or https://"
        render check_jira_group_plan_path
      else
        session[:jira_url] = params[:user][:jira_url]
        users = User.where(:jira_url =&gt; session[:jira_url])
        if users.count &gt; 0
          current_user.jira_url = session[:jira_url]
          current_user.save
          redirect_to new_auth_jira_path
        else
          redirect_to jira_integration_path(:full_setup =&gt; true)
        end
      end
    end
  </code></pre>
  
  <p>The spec I am writing:</p>
  
  <pre><code>require 'spec_helper'
  
  describe IntegrationController do
    let(:user) { FactoryGirl.create(:user, :without_callbacks, :email =&gt; 'test@c.com') }
  
    describe 'check jira url' do
      before { sign_in_user(user) }
      it 'flashes error message for blank url' do
        post :check_jira_url, {:jira_url =&gt; ''}
        expect(flash[:error]).to be_present
        response.should render_template(:action=&gt; 'check_jira_group_plan')
      end
    end
  end
  </code></pre>
  
  <p>I keep getting the following error:</p>
  
  <pre><code>expected present? to return true, got false
  ./spec/controllers/integration_controler_spec.rb:10:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>What am I doing wrong?</p>