From 32326ff4afc178e1a71ebf75f3757989cb977fb8 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 14 Mar 2016 11:46:45 +0800 Subject: [PATCH] update map/topic delete action test --- spec/controllers/maps_controller_spec.rb | 6 ++++-- spec/controllers/topics_controller_spec.rb | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/controllers/maps_controller_spec.rb b/spec/controllers/maps_controller_spec.rb index 67950d75..35c3ddcc 100644 --- a/spec/controllers/maps_controller_spec.rb +++ b/spec/controllers/maps_controller_spec.rb @@ -89,7 +89,8 @@ RSpec.describe MapsController, type: :controller do expect do delete :destroy, { id: unowned_map.to_param, format: :json } end.to change(Map, :count).by(0) - expect(response.body).to eq("unauthorized") + expect(response.body).to eq '' + expect(response.status).to eq 403 end it 'deletes owned map' do @@ -97,7 +98,8 @@ RSpec.describe MapsController, type: :controller do expect do delete :destroy, { id: owned_map.to_param, format: :json } end.to change(Map, :count).by(-1) - expect(response.body).to eq("success") + expect(response.body).to eq '' + expect(response.status).to eq 204 end end end diff --git a/spec/controllers/topics_controller_spec.rb b/spec/controllers/topics_controller_spec.rb index 4cce6851..2fc99b22 100644 --- a/spec/controllers/topics_controller_spec.rb +++ b/spec/controllers/topics_controller_spec.rb @@ -92,10 +92,7 @@ RSpec.describe TopicsController, type: :controller do expect do delete :destroy, { id: owned_topic.to_param, format: :json } end.to change(Topic, :count).by(-1) - end - - it 'return 204 NO CONTENT' do - delete :destroy, { id: owned_topic.to_param, format: :json } + expect(response.body).to eq '' expect(response.status).to eq 204 end end