title: post functional test failing
body: <p>I am trying to create a functional test that tests the create method in one of my controllers. For the life of me, I cannot figure out why this is failing. I am getting one failure, and zero errors:</p>
  
  <pre><code>1) Failure:
  test_should_create_order(OrdersControllerTest) [/Users/user/rails_work/depot/test/functional/orders_controller_test.rb:38]:
  "Order.count" didn't change by 1.
  &lt;3&gt; expected but was
  &lt;2&gt;.
  </code></pre>
  
  <p>So, Im pretty sure this means that my functionals test was unable to make an Order. Here is my test:</p>
  
  <pre><code>  setup do
      @order = orders(:one)
    end
  
    test "should create order" do
      assert_difference('Order.count') do
        post :create, order: @order.attributes.slice(Order.accessible_attributes)
      end
  
      assert_redirected_to store_url
    end
  </code></pre>
  
  <p>my orders fixture:</p>
  
  <pre><code>one:
    name: Dave Thomas
    address: MyText
    email: dave@example.org
    pay_type: Check
  </code></pre>
  
  <p>and my Order#create controller:</p>
  
  <pre><code>def create
      @order = Order.new(params[:order])
      @order.add_line_items_from_cart(current_cart)
  
      respond_to do |format|
        if @order.save
          Cart.destroy(session[:cart_id])
          session[:cart_id] = nil 
          format.html { redirect_to store_url, notice: 'Thank you for your order' }
          format.json { render json: @order, status: :created, location: @order }
        else
          @cart = current_cart
          format.html { render action: "new" }
          format.json { render json: @order.errors, status: :unprocessable_entity }
        end
      end
    end
  </code></pre>
  
  <p>Now, if I change the setup method in my functional test to:</p>
  
  <pre><code>@order = Order.create(orders(:one))
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>@order = orders(:one)
  </code></pre>
  
  <p>The failure disappears, but I get about 8 of these errors:</p>
  
  <pre><code>NoMethodError: undefined method `stringify_keys' for #&lt;Order:0x007f8c62dbb960&gt;
  </code></pre>
  
  <p>If anyone can help me fix this functional test, I would more than appreciate it. Any and all input is welcome. </p>