The syntax has changed a bit for Rails 5 and rspec> 3.1 (I believe)
for POST requests:
post :create, xhr: true, params: { polls: { question: 'some' } }
Now you need to install params exactly
for GET requests:
get :action, xhr: true, params: { id: 10 }
for rails 4 and rspec <= 3.1
xhr post :create, { polls: { question: 'some' } }
GET inquiries:
xhr get :show, id: 10
user1136228 Feb 16 '18 at 9:23 2018-02-16 09:23
source share