Why am I getting the error below? When running a rspec test in console, I get the error that 'post' is unknown. yet the line of code that is failing is structured as such:
post :create, valid_params
as such:
it "assigns the new post to @post" do
post :create, post: {title: RandomData.random_sentence, body: RandomData.random_paragraph}
expect(assigns(:post)).to eq Post.last
end
Here is the error
1) PostsController POST create assigns the new post to @post
Failure/Error: post :create, post: {title: RandomData.random_sentence, body: RandomData.random_paragraph}
ArgumentError:
unknown keyword: post