thoughtbot / ios-on-rails

A guide to building a Rails API and iOS app
Other
77 stars 6 forks source link

response_json undefined #36

Closed nicolo closed 10 years ago

nicolo commented 10 years ago

When trying to run the firs test in creating a get requestion https://github.com/thoughtbot/ios-on-rails/blob/master/book/rails/creating_a_get_request.md

https://github.com/thoughtbot/ios-on-rails/blob/master/example_apps/rails/spec/requests/api/v1/events/events_spec.rb

I'm receiving the following error:

undefined local variable or method `response_json' for #RSpec::Core::ExampleGroup::Nested_1:0x007ff5c42ada70

Am I missing something?

jessieay commented 10 years ago

Hi @nicolo ! I was just noticing this as a problem the other day. response_json comes from a method defined in spec/support - check out https://github.com/thoughtbot/ios-on-rails/blob/master/example_apps/rails/spec/support/response_json.rb

Should explain this in the book! Thanks for opening the issue. WIll leave it open until this is explained

nicolo commented 10 years ago

Yes adding that file fixed the problem. Thanks.

jruef commented 10 years ago

thx @nicolo for mentioning that problem and @jessieay for the solution, saved me a lot of time :smile: