DEV: Add a basic account creation system spec (#24179)

This commit is contained in:
Jarek Radosz 2023-10-31 14:53:24 +01:00 committed by GitHub
parent dbb532bae7
commit 231e02446b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# frozen_string_literal: true
describe "Create account", type: :system do
it "creates a user account" do
visit "/"
click_button "Sign Up"
expect(page).to have_css(".d-modal.create-account")
find("#new-account-email").fill_in with: "test@example.com"
find("#new-account-username").fill_in with: "user1"
expect(page.find("#username-validation")).to have_content("Your username is available")
find("#new-account-password").fill_in with: "secret-password"
click_button "Create your account"
expect(page).to have_no_css(".d-modal.create-account")
user = User.last
expect(user.username).to eq("user1")
expect(user.emails).to eq(["test@example.com"])
end
end