Skip to content

Instantly share code, notes, and snippets.

@jamiely
Created August 12, 2011 01:11
Show Gist options
  • Select an option

  • Save jamiely/1141234 to your computer and use it in GitHub Desktop.

Select an option

Save jamiely/1141234 to your computer and use it in GitHub Desktop.
Intermap - API Issue 20110811 - Non-cascading delete
1. New Project
2. Add Term "apple"
3. Add Term "bear"
4. Create interaction between "apple" and "bear"
5. Delete Term "apple"
1 3 NULL POST /api/v1/projects {"name":"New Project 1","description":""} 2011-08-11 21:01:18 201 55 application/json 127.0.0.1
2 3 6 GET /api/v1/projects/6/full NULL 2011-08-11 21:01:18 200 790 127.0.0.1
3 3 6 POST /api/v1/terms/ {"text":"a","central":false,"projectId":6,"degreeCentrality":0,"sortOrder":1} 2011-08-11 21:01:21 201 46 application/json 127.0.0.1
4 3 6 POST /api/v1/terms/ {"text":"b","central":false,"projectId":6,"degreeCentrality":0,"sortOrder":2} 2011-08-11 21:01:23 201 79 application/json 127.0.0.1
5 3 6 POST /api/v1/terms/ {"text":"b","central":false,"projectId":6,"degreeCentrality":0,"sortOrder":2} 2011-08-11 21:01:23 201 69 application/json 127.0.0.1
6 3 6 POST /api/v1/interactions {"termA":151,"termB":149,"relationship":"+","comment":""} 2011-08-11 21:01:23 201 59 application/json 127.0.0.1
7 3 6 DELETE /api/v1/terms/149 NULL 2011-08-11 21:01:27 200 43 127.0.0.1
8 3 6 DELETE /api/v1/terms/150 NULL 2011-08-11 21:01:29 200 39 127.0.0.1
<cffunction name="DELETE_term_cascades_to_interactions">
<!--- delete termB instead of termA --->
<cfset local.result = apiCall("DELETE", "/terms/2") />
<cfset debug(local.result) />
<cfset assertEquals("200 OK", local.result.statuscode, "Was not able to delete") />
<cfset local.result = apiCall("GET", "/interactions/1") />
<cfset debug(local.result) />
<cfset assertEquals("404 Not Found", local.result.statuscode, "Delete was not successful") />
<cfset local.result = apiCall("GET", "/interactions/3") />
<cfset debug(local.result) />
<cfset assertEquals("404 Not Found", local.result.statuscode) />
<cfset local.result = apiCall("GET", "/interactions/2") />
<cfset debug(local.result) />
<cfset assertEquals("200 OK", local.result.statuscode) />
</cffunction>
@atuttle

atuttle commented Aug 12, 2011

Copy link
Copy Markdown

resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment