tabletop-companion/test/system/sessions_test.rb

27 lines
854 B
Ruby
Raw Permalink Normal View History

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
2024-06-19 15:42:15 +00:00
test "unverified users cannot log in" do
visit new_session_url
fill_in attr_name(User, :username), with: users(:unverified).username
fill_in attr_name(User, :password), with: "password"
click_button I18n.t("sessions.new.log_in")
assert_text I18n.t("sessions.create.not_verified")
end
2024-04-21 14:01:10 +00:00
end