akabiru / todos-api

🍻 🍾 @scotch-io tutorial "Build a RESTful JSON API with Rails 5" codebase.
https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one
MIT License
188 stars 101 forks source link

Failure/Error: expect(json['title']).to eq('Learn Elm') #30

Closed akhmadodi closed 5 years ago

akhmadodi commented 5 years ago

Hi, I got this error when run bundle exec rspec

Failures:

1) Todos API POST /todos when the request is valid creates a todo Failure/Error: expect(json['title']).to eq('Learn Elm')

 NoMethodError:
   undefined method `[]' for nil:NilClass

Finished in 1.1 seconds (files took 3.14 seconds to load) 18 examples, 1 failure

Failed examples:

rspec ./spec/requests/todos_spec.rb:60 # Todos API POST /todos when the request is valid creates a todo

Could you please help me Thanks