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

Popular posts from this blog

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -

c# - MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3243,9): error MSB4094 -