2024-05-26 10:45:10 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-04-21 14:01:10 +00:00
|
|
|
require "application_system_test_case"
|
|
|
|
|
|
|
|
class SignUpsTest < ApplicationSystemTestCase
|
|
|
|
test "can log in, then out" do
|
|
|
|
visit new_session_url
|
|
|
|
fill_in attr_name(User, :username), with: users(:trevor).username
|
|
|
|
fill_in attr_name(User, :password), with: "password"
|
|
|
|
click_button I18n.t("sessions.new.log_in")
|
|
|
|
|
|
|
|
assert_text I18n.t("sessions.create.success", name: users(:trevor).first_name)
|
|
|
|
|
|
|
|
click_on I18n.t("sessions.destroy.log_out")
|
|
|
|
assert_text I18n.t("sessions.destroy.success")
|
|
|
|
end
|
|
|
|
end
|