Destroy unconfirmed commands so that they don't end up in the user history
This commit is contained in:
@@ -11,6 +11,7 @@ class CommandsController < ApplicationController
|
||||
result = command.execute
|
||||
respond_with_execution_result(result)
|
||||
else
|
||||
command.destroy
|
||||
render plain: command.title, status: :conflict
|
||||
end
|
||||
else
|
||||
|
||||
@@ -22,7 +22,7 @@ class CommandsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "commands requiring confirmation return a 409 conflict response" do
|
||||
assert_difference -> { users(:kevin).commands.count }, +1 do
|
||||
assert_no_difference -> { users(:kevin).commands.count } do
|
||||
post commands_path, params: { command: "/assign @kevin" }, headers: { "HTTP_REFERER" => cards_path }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user