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

Test case errors #27

Closed hafeez84 closed 5 years ago

hafeez84 commented 5 years ago

Posts API POST /api/posts when the request is valid creates a post Failure/Error: render json: post, status: status

 NoMethodError:
   undefined method `to_i' for {:status=>201}:Hash
   Did you mean?  to_s
                  to_a
                  to_h

I tried it with several changes. since it says it's an hash i did expect(response.status).to have_http_status(201) but still didnt work.