Skip to content

A platform for community discussion. Free, open, simple.

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

Jarek Radosz231e02446b92
diff --git a/spec/system/create_account_spec.rb b/spec/system/create_account_spec.rb
new file mode 100644
index 00000000000..212dfde0770
--- /dev/null
+++ b/spec/system/create_account_spec.rb
@@ -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: "[email protected]"
+
+ 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(["[email protected]"])
+ end
+end