Skip to content

Instantly share code, notes, and snippets.

@xetorthio
Created May 21, 2010 18:34
Show Gist options
  • Save xetorthio/409231 to your computer and use it in GitHub Desktop.
Save xetorthio/409231 to your computer and use it in GitHub Desktop.
story "As a consumer I want to get details of a user so I can show the user information in my own site", {
scenario "Get user information anonymously without filtering", {
def facebook = new groovyx.net.http.RESTClient("https://graph.facebook.com/")
def response = facebook.get(path:"jleibiusky")
assert response.status == 200
assert response.data.name == "Jonathan Leibiusky"
assert response.data.first_name == "Jonathan"
}
scenario "Get user information anonymously filtering by fields", {
def facebook = new groovyx.net.http.RESTClient("https://graph.facebook.com/")
def response = facebook.get(path:"jleibiusky", query:[fields:"name"])
assert response.status == 200
assert response.data.name == "Jonathan Leibiusky"
assert response.data.first_name == null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment