Skip to content

Instantly share code, notes, and snippets.

@dreamr
Created November 29, 2010 05:20
Show Gist options
  • Save dreamr/719608 to your computer and use it in GitHub Desktop.
Save dreamr/719608 to your computer and use it in GitHub Desktop.
JSON specs (DESTROY) failing for comment and post
1) Admin::CommentsController handling DELETE to destroy, JSON request renders comment as json
Failure/Error: response.should contain(/#{Regexp.escape(@comment.to_json)}/)
expected the following element's content to match /\{"comment":\{"body_html":null,"created_at":null,"author":"xavier","body":null,"updated_at":null,"post_id":null,"author_email":null,"author_url":null\}\}/:
{"comment":{"comment":{"created_at":null,"body_html":null,"body":null,"author":"xavier","updated_at":null,"post_id":null,"author_email":null,"author_url":null}},"undo_path":"/admin/undo_items/%23%5BRSpec::Mocks::Mock:0x82b32e8c%20@name=%22undo_item%22%5D/undo","undo_message":"hello"}
# ./spec/controllers/admin/comments_controller_spec.rb:129
2) Admin::PostsController handling DELETE to destroy, JSON request renders post as json
Failure/Error: response.should contain(/#{Regexp.escape(@post.to_json)}/)
expected the following element's content to match /\{"post":\{"cached_tag_list":null,"slug":null,"body_html":null,"created_at":null,"body":null,"title":"A\ post","approved_comments_count":0,"updated_at":null,"published_at":null,"edited_at":null,"active":true\}\}/:
{"post":{"post":{"slug":null,"cached_tag_list":null,"created_at":null,"body_html":null,"title":"A post","body":null,"updated_at":null,"approved_comments_count":0,"published_at":null,"edited_at":null,"active":true}},"undo_path":"/admin/undo_items/%23%5BRSpec::Mocks::Mock:0x82aadf20%20@name=%22undo_item%22%5D/undo","undo_message":"hello"}
# ./spec/controllers/admin/posts_controller_spec.rb:166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment