24 lines
530 B
Ruby
24 lines
530 B
Ruby
require "application_system_test_case"
|
|
|
|
class SessionsTest < ApplicationSystemTestCase
|
|
setup do
|
|
@user = users(:one)
|
|
end
|
|
|
|
test "should create session" do
|
|
login(@user.email)
|
|
|
|
assert_text "Session was successfully created"
|
|
end
|
|
|
|
test "should destroy Session" do
|
|
login(@user.email)
|
|
|
|
visit root_url
|
|
# Open the user dropdown by clicking the checkbox label
|
|
find('label[for="user-dropdown"]').click
|
|
click_on "Log out", match: :first
|
|
|
|
assert_text "Session was successfully destroyed"
|
|
end
|
|
end
|