Skip to content

Instantly share code, notes, and snippets.

@mguterl
Created July 16, 2011 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mguterl/1086401 to your computer and use it in GitHub Desktop.
Save mguterl/1086401 to your computer and use it in GitHub Desktop.
user = create_user :first_name => "Steve", :last_name => "Richert"
users = fetch_users
# pick your poison
users.size.should == 1
users.should have(1).item
users.first.should == {
"id" => user.id,
"first_name" => "Steve",
"last_name" => "Richert"
}
# or maybe just this?
users.should == [{
"id" => user.id,
"first_name" => "Steve",
"last_name" => "Richert"
}]
post "/users.json", "first_name" => "Steve", "last_name" => "Richert"
user_id = json['id']
get "/users.json"
json.size.should == 1
json.first.should == {
"id" => user_id,
"first_name" => "Steve",
"last_name" => "Richert"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment