sarting to generalize profiles

This commit is contained in:
2023-01-16 00:17:22 +02:00
parent 485c0475b7
commit 4ffc6e3c85
26 changed files with 165 additions and 207 deletions

View File

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

View File

@ -1,47 +0,0 @@
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