I'm starting the rspec tests in RubyOnRails and I'm having a problem testing my controller's create:
it "creates lançamento" do
post :create, params: attributes_for(:lancamento), format: :js, xhr: true
expect(Lancamento.count).to eq(1)
end
I've already created the factory with FactoryGirl. The error is as follows:
1) LancamentosController testa cadastro lançamento creates lançamento
Failure/Error: params.require(:lancamento).permit(Lancamento.fields)
ActionController::ParameterMissing:
param is missing or the value is empty: lancamento
Any help is welcome, thanks!