Done with backend implementation. NEXT: Frontend resource loading and FBJS interfaces.

pull/1351/head
Rick Carlino 2019-08-05 14:59:55 -05:00
parent 65ada4efec
commit 23744364e5
2 changed files with 10 additions and 10 deletions

View File

@ -1,11 +1,3 @@
module PointGroups
class Destroy < Mutations::Command
required do
model :device, class: Device
end
def execute
raise "Not yet implemented"
end
end
Destroy = CreateDestroyer.run!(resource: PointGroup)
end

View File

@ -5,5 +5,13 @@ describe Api::PointGroupsController do
let(:user) { FactoryBot.create(:user) }
let(:device) { user.device }
it "destroy a point group"
it "destroy a point group" do
sign_in user
pg =
PointGroups::Create.run!(device: device, name: "PG test", point_ids: [])
delete :destroy, params: { id: pg.id }
expect(response.body).to eq("")
expect(response.status).to eq(200)
expect(PointGroup.where(id: pg.id).count).to eq(0)
end
end