ruby on rails - Rspec expect keeps throwing a TypeError: nil is not a symbol -
so have test in app:
expect{ post :create, :name=> 'abc' }.to change(event.count).from(0).to(1)
and keeps throwing error:
typeerror: nil not symbol
would know why?
found out issue. should using {} instead of (). should instead:
expect{ post :create, :name=> 'abc' }.to change{event.count}.from(0).to(1)
Comments
Post a Comment