left4me/rails/test/controllers/executions_controller_test.rb
mwiegand 5ab99c7779
wip
2022-11-27 17:32:21 +01:00

48 lines
1.2 KiB
Ruby

require "test_helper"
class ExecutionsControllerTest < ActionDispatch::IntegrationTest
setup do
@execution = executions(:one)
end
test "should get index" do
get executions_url
assert_response :success
end
test "should get new" do
get new_execution_url
assert_response :success
end
test "should create execution" do
assert_difference("Execution.count") do
post executions_url, params: { execution: { command_id: @execution.command_id, value: @execution.value } }
end
assert_redirected_to execution_url(Execution.last)
end
test "should show execution" do
get execution_url(@execution)
assert_response :success
end
test "should get edit" do
get edit_execution_url(@execution)
assert_response :success
end
test "should update execution" do
patch execution_url(@execution), params: { execution: { command_id: @execution.command_id, value: @execution.value } }
assert_redirected_to execution_url(@execution)
end
test "should destroy execution" do
assert_difference("Execution.count", -1) do
delete execution_url(@execution)
end
assert_redirected_to executions_url
end
end