DEV: Add a basic account creation system spec (#24179)
This commit is contained in:
parent
dbb532bae7
commit
231e02446b
|
@ -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
|
Loading…
Reference in New Issue