Added destroy API method for pages and fixed feature

This commit is contained in:
Alex Sanford 2012-04-24 12:13:26 -03:00
parent f53ab18f90
commit bf65fa47f3
2 changed files with 7 additions and 2 deletions

View File

@ -25,6 +25,12 @@ module Locomotive
respond_with @page, :location => main_app.locomotive_api_pages_url
end
def destroy
@page = current_site.pages.find(params[:id])
@page.destroy
respond_with @page
end
end
end

View File

@ -211,5 +211,4 @@ Feature: Pages
When I do an API GET request to pages.json
Then the JSON response should contain 4 pages
When I do an API DELETE to pages/4f832c2cb0d86d3f42fffffe.json
When I do an API GET request to pages.json
Then the JSON response should contain 3 pages
Then the JSON response should be an access denied error