Done with backend implementation. NEXT: Frontend resource loading and FBJS interfaces.
parent
65ada4efec
commit
23744364e5
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue