Ruby on Rails
Sunday, September 8, 2013
Thanks everyone for your help,
-- I have found the answer here http://stackoverflow.com/questions/18337609/rspec-request-test-merges-hashes-in-array-in-post-json-params
It seems that the request parameters I was sending was not the correct ones.
this worked
it "should return an error if there is no correct email" do params = {:subscription => {:email => "andre"}} post "/magazine_subscriptions", params.to_json, {'ACCEPT' => "application/json", 'CONTENT_TYPE' => 'application/json'} endYou received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAA6P50bicuMMMQQ5uJA7_%3Dk%3DF-t16DK5DirRqmBMQBVdKuxF%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment