You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
62 lines
1.6 KiB
require "application_system_test_case"
|
|
|
|
class UsersTest < ApplicationSystemTestCase
|
|
setup do
|
|
@user = users(:one)
|
|
end
|
|
|
|
test "visiting the index" do
|
|
visit users_url
|
|
assert_selector "h1", text: "Users"
|
|
end
|
|
|
|
test "creating a User" do
|
|
visit users_url
|
|
click_on "New User"
|
|
|
|
fill_in "Id number", with: @user.ID_number
|
|
fill_in "Email", with: @user.email
|
|
fill_in "Last login on", with: @user.last_login_on
|
|
fill_in "Login", with: @user.login
|
|
fill_in "Nickname", with: @user.nickname
|
|
fill_in "Password", with: @user.password
|
|
fill_in "Phone", with: @user.phone
|
|
fill_in "Salt", with: @user.salt
|
|
fill_in "Status", with: @user.status
|
|
fill_in "Student number", with: @user.student_number
|
|
click_on "Create User"
|
|
|
|
assert_text "User was successfully created"
|
|
click_on "Back"
|
|
end
|
|
|
|
test "updating a User" do
|
|
visit users_url
|
|
click_on "Edit", match: :first
|
|
|
|
fill_in "Id number", with: @user.ID_number
|
|
fill_in "Email", with: @user.email
|
|
fill_in "Last login on", with: @user.last_login_on
|
|
fill_in "Login", with: @user.login
|
|
fill_in "Nickname", with: @user.nickname
|
|
fill_in "Password", with: @user.password
|
|
fill_in "Phone", with: @user.phone
|
|
fill_in "Salt", with: @user.salt
|
|
fill_in "Status", with: @user.status
|
|
fill_in "Student number", with: @user.student_number
|
|
click_on "Update User"
|
|
|
|
assert_text "User was successfully updated"
|
|
click_on "Back"
|
|
end
|
|
|
|
test "destroying a User" do
|
|
visit users_url
|
|
page.accept_confirm do
|
|
click_on "Destroy", match: :first
|
|
end
|
|
|
|
assert_text "User was successfully destroyed"
|
|
end
|
|
end
|