title: undefined method `stringify_keys' when creating record in Rspec
body: <p>There is a session variable used in controller for create. How to set the session variable for rspec test? </p>
  
  <p>Here is the method create in controller w/ session[eng_dh] :</p>
  
  <pre><code>  def create
      if session[:eng_dh] 
  
        @category = Category.new(params[:category], :as =&gt; :roles_new)    
  
        if @category.save
  
          redirect_to categories_path, :notice =&gt; 'Category was successfully created.'         
        else
          render :action =&gt; "new" 
        end
      else
        redirect_to categories_path, :notice =&gt;"NO access to create category!"
      end
    end 
  </code></pre>
  
  <p>Here is the failing rspec code:</p>
  
  <pre><code>require 'spec_helper'
  
  describe CategoriesController do
    before(:each) do
      #the following recognizes that there is a before filter without execution of it.
      controller.should_receive(:require_signin)
      controller.should_receive(:require_employee)
    end
  
    render_views
  
    describe "Post 'create'" do
      describe "success" do
        before(:each) do
          @category = Factory(:category)
          session[:eng_dh] = true  #THIS LINE CAUSED ERROR ( undefined method `stringify_keys' for "1":String) IN RSPEC TEST!!!
        end
  
        it "should create a category" do
          lambda do
            post :create, :category =&gt; @category
          end.should change(Category, :count).by(1)
        end
  
        it "should redirect to the category index page" do
          post :create, :category =&gt; @category
          response.should redirect_to(categories_path)
        end
      end
  
    end
  end
  </code></pre>
  
  <p>Any solutions? Thanks.</p>