2024-07-16 20:22:59 +02:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
|
|
class ChecklistsControllerTest < ActionDispatch::IntegrationTest
|
|
|
|
|
setup do
|
|
|
|
|
@checklist = checklists(:one)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should get index" do
|
|
|
|
|
get checklists_url
|
|
|
|
|
assert_response :success
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should get new" do
|
|
|
|
|
get new_checklist_url
|
|
|
|
|
assert_response :success
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should create checklist" do
|
|
|
|
|
assert_difference("Checklist.count") do
|
2024-07-26 00:59:00 +02:00
|
|
|
post checklists_url, params: { checklist: { code: @checklist.code, description_html: @checklist.description_html, name: @checklist.name } }
|
2024-07-16 20:22:59 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
assert_redirected_to checklist_url(Checklist.last)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should show checklist" do
|
|
|
|
|
get checklist_url(@checklist)
|
|
|
|
|
assert_response :success
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should get edit" do
|
|
|
|
|
get edit_checklist_url(@checklist)
|
|
|
|
|
assert_response :success
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should update checklist" do
|
2024-07-26 00:59:00 +02:00
|
|
|
patch checklist_url(@checklist), params: { checklist: { code: @checklist.code, description_html: @checklist.description_html, name: @checklist.name } }
|
2024-07-16 20:22:59 +02:00
|
|
|
assert_redirected_to checklist_url(@checklist)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "should destroy checklist" do
|
|
|
|
|
assert_difference("Checklist.count", -1) do
|
|
|
|
|
delete checklist_url(@checklist)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
assert_redirected_to checklists_url
|
|
|
|
|
end
|
|
|
|
|
end
|