adding teacher profiles

This commit is contained in:
2023-01-15 14:52:40 +02:00
parent 45f59f174b
commit 750bd76a7e
21 changed files with 288 additions and 32 deletions

View File

@ -0,0 +1,47 @@
require "application_system_test_case"
class TeachersTest < ApplicationSystemTestCase
setup do
@teacher = teachers(:one)
end
test "visiting the index" do
visit teachers_url
assert_selector "h1", text: "Teachers"
end
test "should create teacher" do
visit teachers_url
click_on "New teacher"
fill_in "Bio", with: @teacher.bio
fill_in "Member", with: @teacher.member_id
fill_in "Name", with: @teacher.name
fill_in "Picture", with: @teacher.picture
click_on "Create Teacher"
assert_text "Teacher was successfully created"
click_on "Back"
end
test "should update Teacher" do
visit teacher_url(@teacher)
click_on "Edit this teacher", match: :first
fill_in "Bio", with: @teacher.bio
fill_in "Member", with: @teacher.member_id
fill_in "Name", with: @teacher.name
fill_in "Picture", with: @teacher.picture
click_on "Update Teacher"
assert_text "Teacher was successfully updated"
click_on "Back"
end
test "should destroy Teacher" do
visit teacher_url(@teacher)
click_on "Destroy this teacher", match: :first
assert_text "Teacher was successfully destroyed"
end
end