mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 13:43:45 +08:00
24 lines
730 B
Ruby
24 lines
730 B
Ruby
# 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"
|
|
|
|
find(".d-modal.create-account").click_button "Sign Up"
|
|
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
|