Show confirmation when submitting certain commands
https://3.basecamp.com/2914079/buckets/37331921/todos/8617430347
This commit is contained in:
@@ -15,12 +15,20 @@ class CommandsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
test "command that triggers a redirect back" do
|
||||
assert_difference -> { users(:kevin).commands.count }, +1 do
|
||||
post commands_path, params: { command: "/assign @kevin" }, headers: { "HTTP_REFERER" => cards_path }
|
||||
post commands_path, params: { command: "/assign @kevin", confirmed: "confirmed" }, headers: { "HTTP_REFERER" => cards_path }
|
||||
end
|
||||
|
||||
assert_redirected_to cards_path
|
||||
end
|
||||
|
||||
test "commands requiring confirmation return a 409 conflict response" do
|
||||
assert_difference -> { users(:kevin).commands.count }, +1 do
|
||||
post commands_path, params: { command: "/assign @kevin" }, headers: { "HTTP_REFERER" => cards_path }
|
||||
end
|
||||
|
||||
assert_response :conflict
|
||||
end
|
||||
|
||||
test "get a 422 on errors" do
|
||||
post commands_path, params: { command: "/assign @some_missing_user" }, headers: { "HTTP_REFERER" => cards_path }
|
||||
assert_response :unprocessable_entity
|
||||
|
||||
Reference in New Issue
Block a user