Prepare system testing

This commit is contained in:
2023-04-11 20:50:13 +02:00
parent 7c77d87213
commit 51985bc88e
6 changed files with 31 additions and 59 deletions

View File

@@ -2,42 +2,27 @@ require "application_system_test_case"
class UsersTest < ApplicationSystemTestCase
setup do
@user = users(:one)
@admin = users(:admin)
end
test "visiting the index" do
visit users_url
assert_selector "h1", text: "Users"
test "sign in" do
visit new_user_session_url
end
test "should create user" do
visit users_url
click_on "New user"
#test "visiting the index" do
# visit users_url
# assert_selector "h1", text: "Users"
#end
fill_in "Email", with: @user.email
fill_in "Status", with: @user.status
click_on "Create User"
#test "should create user" do
# visit users_url
# click_on "New user"
assert_text "User was successfully created"
click_on "Back"
end
# fill_in "Email", with: @user.email
# fill_in "Status", with: @user.status
# click_on "Create User"
test "should update User" do
visit user_url(@user)
click_on "Edit this user", match: :first
fill_in "Email", with: @user.email
fill_in "Status", with: @user.status
click_on "Update User"
assert_text "User was successfully updated"
click_on "Back"
end
test "should destroy User" do
visit user_url(@user)
click_on "Destroy this user", match: :first
assert_text "User was successfully destroyed"
end
# assert_text "User was successfully created"
# click_on "Back"
#end
end