Files
vault171/test/controllers/items_controller_test.rb
David Böhm 44d019b4b5
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
Added Items and Dashboard
2026-05-22 03:52:54 +02:00

49 lines
933 B
Ruby

require "test_helper"
class ItemsControllerTest < ActionDispatch::IntegrationTest
setup do
@item = items(:one)
end
test "should get index" do
get items_url
assert_response :success
end
test "should get new" do
get new_item_url
assert_response :success
end
test "should create item" do
assert_difference("Item.count") do
post items_url, params: { item: {} }
end
assert_redirected_to item_url(Item.last)
end
test "should show item" do
get item_url(@item)
assert_response :success
end
test "should get edit" do
get edit_item_url(@item)
assert_response :success
end
test "should update item" do
patch item_url(@item), params: { item: {} }
assert_redirected_to item_url(@item)
end
test "should destroy item" do
assert_difference("Item.count", -1) do
delete item_url(@item)
end
assert_redirected_to items_url
end
end