parent
0f95034e8e
commit
c64550785e
15 changed files with 84 additions and 11 deletions
|
@ -6,13 +6,14 @@ class UsersTest < ApplicationSystemTestCase
|
|||
end
|
||||
|
||||
test "visiting the index" do
|
||||
login(@user.email)
|
||||
visit users_url
|
||||
assert_selector "h1", text: "Users"
|
||||
end
|
||||
|
||||
test "should create user" do
|
||||
visit users_url
|
||||
click_on "New user"
|
||||
click_on "Sign up"
|
||||
|
||||
fill_in "Email", with: "userthree@example.local"
|
||||
fill_in "Password", with: "secret"
|
||||
|
@ -24,6 +25,7 @@ class UsersTest < ApplicationSystemTestCase
|
|||
end
|
||||
|
||||
test "should update User" do
|
||||
login(@user.email)
|
||||
visit user_url(@user)
|
||||
click_on "Edit this user", match: :first
|
||||
|
||||
|
@ -37,7 +39,8 @@ class UsersTest < ApplicationSystemTestCase
|
|||
end
|
||||
|
||||
test "should destroy User" do
|
||||
visit user_url(@user)
|
||||
login(@user.email)
|
||||
visit user_url(users(:two))
|
||||
click_on "Destroy this user", match: :first
|
||||
|
||||
assert_text "User was successfully destroyed"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue