Skip to content

Instantly share code, notes, and snippets.

@bobthecow
Created July 10, 2012 22:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobthecow/3086595 to your computer and use it in GitHub Desktop.
Save bobthecow/3086595 to your computer and use it in GitHub Desktop.
last_response.body.should match_json({
user: {
id: :user_id,
username: 'chancancode',
full_name: 'Godfrey Chan',
email: 'godfrey@example.com',
type: 'Administrator',
points: Fixnum,
homepage: /\Ahttps?\:\/\/.*\z/i,
created_at: WILDCARD_MATCHER,
updated_at: WILDCARD_MATCHER,
posts: [
{
id: Fixnum,
subject: 'Hello world!',
user_id: :user_id,
}.ignore_extra_keys!,
{
id: Fixnum,
subject: 'An awesome blog post',
user_id: :user_id,
}.ignore_extra_keys!
].ordered!
}
})
last_response.body.should match_json({
'user' => {
'id' => :user_id,
'username' => 'chancancode',
'full_name' => 'Godfrey Chan',
'email' => 'godfrey@example.com',
'type' => 'Administrator',
'points' => Fixnum,
'homepage' => /\Ahttps?\:\/\/.*\z/i,
'created_at' => WILDCARD_MATCHER,
'updated_at' => WILDCARD_MATCHER,
'posts' => [
{
'id' => Fixnum,
'subject' => 'Hello world!',
'user_id' => :user_id
}.ignore_extra_keys!,
{
'id' => Fixnum,
'subject' => 'An awesome blog post',
'user_id' => :user_id
}.ignore_extra_keys!
].ordered!
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment