dimanche 30 avril 2017

ArgumentError when trying to pass nested parameters in rspec

When I'm trying to execute the following line

post :create, user: Fabricate.attributes_for(:user)

I get this error message ArgumentError: unknown keyword: user.
Here's the code I was originally trying to run:

describe 'POST create' do context 'with valid input' do it 'creates the user' do post :create, user: Fabricate.attributes_for(:user) expect(User.count).to eq(1) end end end

Aucun commentaire:

Enregistrer un commentaire