title: Test Rails CRUD methods with RSpec
body: <p>I have a <code>Post</code> object in my Rails app that I am trying to write request tests for. I keep getting an <code>ArgumentError: unknown keyword: post</code> error. Here is my request spec: </p>
  
  <pre><code>require 'rails_helper'
  
  RSpec.describe "Post", :type =&gt; :request do
    describe '#create' do
      it "creates a Post and redirects to the Post's page" do
        get "/posts/new"
        expect(response).to render_template(:new)
  
  ### This is where the error is happening. On the `post` method.
        post "/posts", :post =&gt; {:title =&gt; "My Post", :content =&gt; "My post content"}
  
        expect(response).to redirect_to(assigns(:post))
        follow_redirect!
  
        expect(response).to render_template(:show)
        expect(response.body).to include("Post was successfully created.")
      end
  
      it "does not render a different template" do
        get "/posts/new"
        expect(response).to_not render_template(:show)
      end
    end
  end
  </code></pre>
  
  <p>I referenced the code from the <a href="https://relishapp.com/rspec/rspec-rails/v/3-8/docs/request-specs/request-spec#specify-managing-a-widget-with-rails-integration-methods" rel="nofollow noreferrer">Relish RSpec Docs</a></p>