Forg/test/system/sign_ups_test.rb

25 lines
864 B
Ruby

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"
click_button I18n.t("users.new.sign_up")
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