From bf65fa47f37a584c870573d792a676dd40b92346 Mon Sep 17 00:00:00 2001 From: Alex Sanford Date: Tue, 24 Apr 2012 12:13:26 -0300 Subject: [PATCH] Added destroy API method for pages and fixed feature --- app/controllers/locomotive/api/pages_controller.rb | 6 ++++++ features/api/authorization/pages.feature | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/locomotive/api/pages_controller.rb b/app/controllers/locomotive/api/pages_controller.rb index 6e6001cf..0af07e37 100644 --- a/app/controllers/locomotive/api/pages_controller.rb +++ b/app/controllers/locomotive/api/pages_controller.rb @@ -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 diff --git a/features/api/authorization/pages.feature b/features/api/authorization/pages.feature index c9d0f41d..14b3170e 100644 --- a/features/api/authorization/pages.feature +++ b/features/api/authorization/pages.feature @@ -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