Skip to content

Commit

Permalink
add response to successful DeleteGroup context
Browse files Browse the repository at this point in the history
  • Loading branch information
npauzenga committed Jan 16, 2016
1 parent 8dae5ca commit 4620770
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/controllers/groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def update
def destroy
result = DeleteGroup.call(id: params[:id])

unless result.success?
if result.success?
head :no_content
else
render json: result.errors, status: :internal_server_error
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/groups_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@
end

context "when DeleteGroup is successful" do
it "returns HTTP status 200" do
it "returns HTTP status 204" do
delete :destroy, params
expect(response).to have_http_status(200)
expect(response).to have_http_status(204)
end
end

Expand Down

0 comments on commit 4620770

Please sign in to comment.