Answer the question
In order to leave comments, you need to log in
How to create a test to log out a user?
Please tell me how to make the tester correctly so that after log in it tests the exit from the account? Swears at logout(:user)
describe "user log in and out" do
it "allows an existing user to sign in" do
User.create!(email: "[email protected]_test.org", password: "135798620")
visit "/users/sign_in"
fill_in "Email", with: "[email protected]_test.org"
fill_in "Password", with: "135798620"
click_button "Log in"
expect(page).to have_content("Signed in successfully.")
end
it "testing logout function" do
logout(:user)
expect(page).to have_content("Signed out successfully.")
end
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question