Some UX improvements

This commit is contained in:
David Schärer 2024-07-19 02:29:18 +02:00
parent 48c0067076
commit 8c81237501
81 changed files with 791 additions and 151 deletions

View file

@ -0,0 +1,48 @@
require "test_helper"
class ChecklistEntriesControllerTest < ActionDispatch::IntegrationTest
setup do
@checklist_entry = checklist_entries(:one)
end
test "should get index" do
get checklist_entries_url
assert_response :success
end
test "should get new" do
get new_checklist_entry_url
assert_response :success
end
test "should create checklist_entry" do
assert_difference("ChecklistEntry.count") do
post checklist_entries_url, params: { checklist_entry: { check_id: @checklist_entry.check_id, checklist_id: @checklist_entry.checklist_id, position: @checklist_entry.position } }
end
assert_redirected_to checklist_entry_url(ChecklistEntry.last)
end
test "should show checklist_entry" do
get checklist_entry_url(@checklist_entry)
assert_response :success
end
test "should get edit" do
get edit_checklist_entry_url(@checklist_entry)
assert_response :success
end
test "should update checklist_entry" do
patch checklist_entry_url(@checklist_entry), params: { checklist_entry: { check_id: @checklist_entry.check_id, checklist_id: @checklist_entry.checklist_id, position: @checklist_entry.position } }
assert_redirected_to checklist_entry_url(@checklist_entry)
end
test "should destroy checklist_entry" do
assert_difference("ChecklistEntry.count", -1) do
delete checklist_entry_url(@checklist_entry)
end
assert_redirected_to checklist_entries_url
end
end

View file

@ -0,0 +1,4 @@
# one:
# record: name_of_fixture (ClassOfFixture)
# name: content
# body: <p>In a <i>million</i> stars!</p>

View file

@ -0,0 +1,45 @@
require "application_system_test_case"
class ChecklistEntriesTest < ApplicationSystemTestCase
setup do
@checklist_entry = checklist_entries(:one)
end
test "visiting the index" do
visit checklist_entries_url
assert_selector "h1", text: "Checklist entries"
end
test "should create checklist entry" do
visit checklist_entries_url
click_on "New checklist entry"
fill_in "Check", with: @checklist_entry.check_id
fill_in "Checklist", with: @checklist_entry.checklist_id
fill_in "Position", with: @checklist_entry.position
click_on "Create Checklist entry"
assert_text "Checklist entry was successfully created"
click_on "Back"
end
test "should update Checklist entry" do
visit checklist_entry_url(@checklist_entry)
click_on "Edit this checklist entry", match: :first
fill_in "Check", with: @checklist_entry.check_id
fill_in "Checklist", with: @checklist_entry.checklist_id
fill_in "Position", with: @checklist_entry.position
click_on "Update Checklist entry"
assert_text "Checklist entry was successfully updated"
click_on "Back"
end
test "should destroy Checklist entry" do
visit checklist_entry_url(@checklist_entry)
click_on "Destroy this checklist entry", match: :first
assert_text "Checklist entry was successfully destroyed"
end
end