tabletop-companion/test/system/sign_ups_test.rb

25 lines
864 B
Ruby
Raw Normal View History

2024-04-21 12:23:37 +00:00
require "application_system_test_case"
class SignUpsTest < ApplicationSystemTestCase
test "can sign up" do
visit new_user_url
fill_in attr_name(User, :username), with: "awesome_user"
fill_in attr_name(User, :first_name), with: "Awesome"
fill_in attr_name(User, :last_name), with: "User"
fill_in attr_name(User, :email), with: "awesome_user@example.com"
fill_in attr_name(User, :password), with: "password"
fill_in attr_name(User, :password_confirmation), with: "password"
2024-04-21 14:01:10 +00:00
click_button I18n.t("users.new.sign_up")
2024-04-21 12:23:37 +00:00
assert_text I18n.t("users.create.success", name: "Awesome")
end
test "can validate email address" do
user = users(:unverified)
token = user.generate_token_for(:email_verification)
visit account_verification_url(id: token)
assert_text I18n.t("account_verifications.show.success")
end
end