Viewing Mode

QA: User Flow Walkthroughs

Use this guide to verify the app manually after initial setup or after a config change. Each section covers exactly one user-facing flow: the environment variables to set, a numbered walkthrough with expected outcomes, and the edge cases worth exercising.

Before you start

Developer tools (development only). Keep these open in separate tabs — they’re the workhorses for QA and accessibility review. Each lives behind its own URL:

Tool What it’s for Where
Lookbook Every UI component in isolation — states, source, and its accessibility contract /lookbook
Dev inbox Every outbound email the app “sends” — magic links, invitations, digests /letter_opener
A11y simulator Vision & colour-blindness filters over the page you’re on the DEV badge in the footer

Email capture. In development every outbound email is intercepted by Letter Opener. Navigate to /letter_opener in a separate tab — keep it open and click Refresh after any action that sends email. You do not need a real email account for any of these flows.

Console and seed. When SIGNUP_MODE=invite_only you need an owner account before you can invite others. Create one with:

bin/rails console
User.create!(email_address: "owner@example.com", first_name: "Test", last_name: "Owner", password: "SecureP@ssw0rd123!")

Or run bin/rails db:seed if you configured the shared-preset seed variables.

Config lives in .env. All environment variables below are read at boot time. After changing .env, restart bin/dev for the change to take effect. The valid values for each variable are documented in .env.example; the app raises on an unrecognized value at startup, except AUTH_PASSWORDS, where anything but enabled leaves passwords off.

Private/incognito windows. Several flows require acting as a different user simultaneously. Use a private window so the two sessions do not share cookies.


Config reference

Variable Where set Values What it controls
SIGNUP_MODE .env open · invite_only Whether new-user signup is open or invite-only. Default: invite_only.
WORKSPACE_ON_SIGNUP .env personal · shared · none Which workspace (if any) a new user lands in after signup. Default: the preset bin/fork recorded in .fork.yml, else personal.
SIGNUP_PERMITTED_JOIN_STRATEGIES .env invite · invite,open_link Instance ceiling on join methods. open_link must appear here before any workspace can enable shareable join links. Default: invite.
TENANCY_WORKSPACE_CREATION .env enabled · disabled Whether the “New workspace” route and UI are available to signed-in users. Default: enabled.
AUTH_PASSWORDS .env disabled · enabled Password sign-in, password reset, /settings/password and the password reauthentication factor; disabled means their routes are not drawn. Default: disabled.
OAuth credentials bin/rails credentials:edit --environment development — Google and GitHub client ID / secret. Without these, the OAuth buttons do not render.

Flow 1 — Signup and invitations

1a. Open signup (SIGNUP_MODE=open)

Config: set SIGNUP_MODE=open in .env and restart bin/dev.

  1. In a private window navigate to /session/new and enter a new email address (one with no existing account). Expect: The check_email page renders inline (Turbo Frame replaces the form). A registration magic-link email is dispatched — check /letter_opener.
  2. Click the registration link in /letter_opener. Expect: MagicLinkCallbacksController#show finds no user for that email and renders the :new_registration view — a name-only form (no password field) with the email pre-filled. Fill in first and last name and submit. Expect: You are signed in immediately and redirected (the app calls start_new_session_for once the registration transaction commits). Your email address is already verified at this point (no separate verification step needed).
  3. Any pending invitation or open-link join token stashed in the session cookie is claimed automatically at this point (no separate verification step needed — email is verified inside the registration transaction).

What SIGNUP_MODE=open does not change. Sign-up is always available to visitors who arrive with a valid session[:pending_invitation_token] or session[:pending_join_token] — even under invite_only. This is by design: an invitation or join-link is what opens the gate.

Onboarding gate under WORKSPACE_ON_SIGNUP=none. If the deployment uses the :none preset, a newly signed-in user who has not yet set onboarded_at is intercepted by the RequiresOnboarding concern and redirected to the onboarding wizard (/onboarding) instead of root_path. See Flow 6 below for the full walkthrough.

1b. Invite-only signup (SIGNUP_MODE=invite_only)

Config: set SIGNUP_MODE=invite_only in .env and restart bin/dev.

  1. In a private window navigate to /session/new, enter a new email address (no existing account), and click Continue. Expect: The same check_email page an existing account gets renders inline, and no email is sent (check /letter_opener). The page must not say signups are closed: that would tell anyone the address has no account. Not a 404, and not Turbo’s “Content missing”.
  2. Check that OAuth buttons on the sign-in page redirect with an alert rather than proceeding when signups are closed — this is the signups_open? guard in the OAuth callback.

1c. Invite flow (owner sends, recipient accepts)

Config: SIGNUP_MODE=invite_only is fine; the invitation itself opens the gate.

  1. Sign in as an owner of a workspace.
  2. Navigate to the workspace’s invitations: /workspaces/:slug/invitations/new. Fill in the recipient’s email address and submit. Expect: The invitation is created and an invitation email is dispatched — check /letter_opener.
  3. Open the invitation email in /letter_opener. Click Accept invitation. The link is GET /invitations/:token/accept. Expect (unauthenticated browser): The accept page (invitation_accepts#show) renders. The token is stashed in session[:pending_invitation_token]. Sign in to accept and Create an account to accept buttons are shown.
  4. From the same browser, navigate to /session/new and enter the invited email address. Expect: The check_email page renders (the session token satisfies signups_open?). Click the registration link in /letter_opener.
  5. Fill in first and last name and submit the :new_registration form (the email is pre-filled and already matches the invitation address). Expect: You are signed in immediately. The email is verified inside the registration transaction. commit_signup_atomically claims the session’s invitation through PendingClaims in that same transaction (email-match guarded) — because your proven email matches the invitation address, the invitation is accepted and you are added to the workspace. You land in that workspace with a success notice.

Existing account signing in. If the recipient already has an account, step 4 signs them in instead. An invitation sent to their email is claimed at sign-in and they land in the workspace; one with no email returns them to its accept page for a click.

Signed-in accept (POST path). If the recipient is already signed in when they click the accept link: POST /invitations/:token/accept calls Invitation.consume! immediately (no deferred email-match check needed — the signed-in user’s proven email is used). If the signed-in email does not match the invitation email, Invitation::EmailMismatch is rescued and a mismatch alert is shown; you are redirected to root_path.

Edge cases — Invitations

  • Single-use. After a successful claim, clicking the same accept link again shows an “expired or used” alert and redirects to root_path.
  • Expired invitation. Invitations expire after 7 days (Invitation::LIFETIME, set at creation). Attempting to accept an expired invitation shows the same “expired or used” alert.
  • Email-bound. An invitation addressed to alice@example.com cannot be claimed by a signed-in user whose email is bob@example.com — Invitation::EmailMismatch is raised and the flow aborts with an alert.
  • Race (already consumed). If two requests attempt to accept the same invitation simultaneously, Invitation#accept! acquires a lock; the loser raises NotAcceptable.

Config: No special config required. Works under any SIGNUP_MODE.

Existing user (passwordless)

  1. Navigate to /session/new (the sign-in page).
  2. Enter an email address that belongs to an existing user without a password and click Continue. The form submits to POST /session/lookup (Sessions::LookupsController#create). Expect: The check_email page renders inline (Turbo Frame replaces the form). In development the heading is a link to /letter_opener.
  3. Open /letter_opener and click the magic-link sign-in email. The link is GET /magic_link_callback/:token. Expect: MagicLinkCallbacksController#show finds the user and renders the :confirm page (“Confirm sign-in”: “You’re about to sign in as …”). The GET does not consume the token or start a session.
  4. Press the confirmation button (POST /magic_link_callback/:token/session). Expect: MagicLinkCallbacks::SessionsController#create atomically consumes the token (prevents double-spend), calls start_new_session_for, and redirects to after_authentication_url. Re-opening the original GET link in this signed-in browser now says “You’re already signed in.”; anywhere else it shows the invalid-token alert.

Existing user (has password)

Config: AUTH_PASSWORDS=enabled. Passwords are off by default, and then the disclosure below does not render.

  1. Navigate to /session/new and enter the email address. Expect: The check_email page renders inline (same as passwordless). A magic-link sign-in email is dispatched — check /letter_opener. The “Prefer to use your password?” disclosure appears for every address, password holder or not, and no link carries the address in its URL.
  2. Open the disclosure → enter the password and submit to POST /session. Expect: You are signed in and redirected to after_authentication_url.
  3. Repeat with a wrong password, then with an address that has no account. Expect: Both re-render the password step (422) with the same error summary, focused, and the address kept. Five wrong passwords lock the account: the page still shows the same message, and the holder receives a “password sign-in is paused” email.

Unknown email (new user)

  1. Navigate to /session/new and enter an email address that has no account. Expect: The check_email page renders (same as passwordless — no user-enumeration difference). When sign-up is open (SIGNUP_MODE=open, or a pending invitation or join-link token), a registration magic-link email is dispatched to that address — check /letter_opener. Under invite_only without one, nothing is sent (Flow 1b).
  2. Click the link in /letter_opener. Expect: MagicLinkCallbacksController#show finds no user for that email. It renders the :new_registration view — a name-only form (no password field) with the email pre-filled.
  3. Fill in first and last name and submit. Expect: A user is created with the email already verified (verified_at: Time.current is set on the email authentication inside the transaction — no separate verification email). You are signed in and redirected.
  4. If SIGNUP_MODE=invite_only and no pending session token, the create action refuses and redirects to new_session_path with an alert before creating any user.
  • 15-minute expiry. The token is valid for exactly 15 minutes (expires_at: 15.minutes.from_now). An expired link shows the invalid-token alert.
  • One-time use. MagicLinkToken.consume! does a compare-and-swap; a second concurrent request for the same token gets nil and is rejected.
  • Token not found. Any unrecognized or malformed token at GET /magic_link_callback/:token shows the invalid-token alert and redirects — authenticated visitors go to root_path, unauthenticated visitors go to new_session_path.

Flow 3 — OAuth sign-in (Google / GitHub)

Config: OAuth credentials must be present in bin/rails credentials:edit --environment development. Without them, the sign-in page shows no OAuth buttons (OauthHelper#oauth_enabled?). A provider round-trip that fails lands on /auth/failure, which redirects to the sign-in page with an error alert.

New user, provider email verified

  1. Navigate to /session/new and click Sign in with Google (or GitHub). The browser is sent to /auth/:provider, then redirects to the provider, then returns to /auth/:provider/callback.
  2. The callback reaches OmniauthCallbacksController#create, which hands the identity to OauthLink#claim. Authentication.find_by(provider:, uid:) finds nothing and no one is signed in, so claim_signup runs.
  3. OauthIdentity#email_verified? returns true (Google explicitly sets email_verified, GitHub is implicitly trusted). claim_verified_signup finds or creates a user by email. Expect: You are signed in immediately and redirected to after_authentication_url. No verification email is sent.

New user, provider email unverified

This path applies when Google explicitly returns info.email_verified: false.

  1. Same flow as above through the callback. OauthIdentity#email_verified? returns false, so claim_unverified_signup runs.
  2. The user record is created and an email Authentication is saved as pending (no verified_at). The pending invitation/join-link tokens from the session (if present) are persisted onto this authentication for deferred claiming. Expect: You are not signed in. You are redirected to new_session_path with a notice: check your email. A verification link email is dispatched — check /letter_opener.
  3. Click the verification link in /letter_opener. It opens a confirmation page, which verifies nothing on its own; press its button. Settings::ConnectedAccountVerificationsController#create verifies the authentication, signs you in (because was_authenticated is false), claims any pending invitation or join-link, and redirects to settings/connected_accounts with a success notice.

Signed-in user linking a provider

  1. Sign in, then navigate to settings/connected_accounts (the sidebar item labelled Security).
  2. Click Connect Google (or GitHub). The browser returns to the callback. Current.user is present, so OauthLink#claim_link runs.
  3. If the OAuth email matches the account’s primary email and email_verified is true: the authentication is created and immediately verified. Expect: Redirect to settings/connected_accounts with a “linked” notice. The provider now appears in the list as verified.
  4. If the OAuth email does not match (or email_verified is false): the authentication is saved as pending. A verification link email is dispatched to the OAuth address — check /letter_opener. Expect: Redirect to settings/connected_accounts with a “pending” notice. The provider appears in the list as “Confirming …” with Resend confirmation and Cancel link actions.
  5. Click the verification link in /letter_opener and press the button on the confirmation page. Expect: The authentication is verified, the pending entry is updated to verified, and you are redirected to settings/connected_accounts with a success notice (you were already authenticated, so was_authenticated is true — no re-sign-in).

Removing a provider (settings/connected_accounts)

Navigate to settings/connected_accounts. Next to a verified provider, click Unlink and confirm.

  • Expect (multiple verified authentications): The provider is removed. Redirect with success notice.
  • Expect (last verified authentication): The row offers no Unlink; it reads “Your only sign-in method”. A DELETE sent anyway is rejected: destroyed_auth.only_verified_remaining? returns true, the destroy is skipped, and you are redirected with the “cannot remove last verified” alert. This prevents locking the user out of their account.

Edge cases — OAuth

  • Cross-user collision. If an attacker attempts to link a Google identity that is already linked to a different account, the legitimate owner receives a defense-in-depth collision-alert email (rate-limited), and the attacker is shown a generic “already linked” alert.
  • Pending re-hit. If you come back through OAuth with an identity whose authentication is still pending (unverified), the verification email is re-sent (subject to the per-recipient throttle) with a “We sent a fresh confirmation link” notice. A signed-in user linking a different account of a provider that already has a pending link gets a “pending in progress” alert on settings/connected_accounts instead, and no email.

Flow 4 — Workspace creation and joining

Creating a workspace

Config: TENANCY_WORKSPACE_CREATION=enabled (default).

  1. Sign in and navigate to /workspaces/new. Expect: The new-workspace form is shown.
  2. Fill in a name and submit. Expect: The workspace is created. You are assigned the owner role atomically with it — the controller calls Workspace.create_owned(attrs, owner: Current.user), which wraps the workspace INSERT and the owner membership in one transaction (the owner role self-heals via Role.system_default!). You are redirected to workspace_path(@workspace).

Config: TENANCY_WORKSPACE_CREATION=disabled. The RequiresWorkspaceCreationEnabled gate on new and create fires. Navigate to /workspaces/new, and as an operator to /operations/workspaces/new — expect a redirect, not the form, on both.

Config required:

  1. SIGNUP_PERMITTED_JOIN_STRATEGIES=invite,open_link — the instance ceiling must include open_link.
  2. The target workspace’s join policy must be set to open_link. A workspace owner opens the workspace’s Limits & Plan settings, chooses Shareable join link under Join policy and saves (this sets workspace.join_policy = "open_link"), then clicks Generate link (this creates a WorkspaceJoinLink, valid for 7 days; the full URL is shown only once).
  3. The workspace must not be personal? — personal workspaces are locked to invite-only at the model level.

Walkthrough — authenticated user joins:

  1. Copy the join URL for the workspace (format: /workspaces/:slug/joins/:token).
  2. In the same browser session (signed in, not yet a member), navigate to that URL. Workspaces::JoinsController#show is called. The before_action :set_workspace_and_link validates the workspace, link, and workspace.accepting_open_joins?. On success the confirmation page renders. Expect: A confirmation page — not a join yet. The GET is intentionally read-only to prevent prefetch and link-unfurlers from triggering automatic admission.
  3. Click Join workspace name (the confirmation form submits POST /workspaces/:slug/joins/:token). admit_authenticated_user calls @link.admit(Current.user), which re-checks the link and the workspace inside the write and then calls workspace.admit(user, role: workspace.default_self_join_role, self_join: true). Expect: Redirect to workspace_path(@workspace) with “joined” notice. You are now a member. Expect (notifications): the workspace owners get “X joined”; you do not — you get your own “You joined …” instead (WorkspaceJoinedNotifier), because nobody is notified about their own action.

Walkthrough — unauthenticated visitor joins (Flow B):

  1. In a private window (no session), navigate to the join URL. Expect: Confirmation page renders (same view — authenticated? check in show does not exist; the before_action only validates the link, not auth state).
  2. Click Join workspace name (POST /workspaces/:slug/joins/:token). stash_for_signup stores the link token in session[:pending_join_token] and redirects to new_session_path. Expect (open signup): Navigate to /session/new, enter your email, click the registration magic link, and fill in name — the pending join-link token satisfies signups_open? even under invite_only. Expect (invite-only): Same — the pending join token opens the gate regardless of SIGNUP_MODE.
  3. On this magic-link registration path the join token is claimed synchronously inside the registration transaction: Signupable#commit_signup_atomically claims it via PendingClaims before the user lands. (The digest-parked-on-Authentication mechanism — pending_join_link_digest + Authentication#claim_pending! — is the OAuth unverified-email path only; see the OAuth section.) Expect: You are signed in and, if the link was still valid, now a member. Because you are a brand-new account, the join is applied automatically (your signup is your consent). Stale conditions (revoked link, policy changed back to invite, instance allowlist tightened) are silently no-op’d — sign-in proceeds and you land without workspace membership.

Edge cases — Workspace join

  • Already a member. If an authenticated user who is already in the workspace navigates to the join URL, show still renders the confirmation; clicking Join redirects to workspace_path(@workspace) with a “You’re already a member” notice.
  • Revoked link. set_workspace_and_link checks join_links.active (unrevoked and unexpired; a link lasts 7 days, WorkspaceJoinLink::LIFETIME). A revoked token produces a neutral “invalid or revoked” alert regardless of which condition failed — no information leakage about workspace existence or join policy.
  • Personal workspace. workspace.open_join? returns false for personal workspaces (the model validates this). The join URL for a personal workspace always produces the “invalid or revoked” alert.
  • open_link removed from allowlist. Removing open_link from SIGNUP_PERMITTED_JOIN_STRATEGIES takes effect immediately at runtime — SignupPolicy.permits_strategy?(:open_link) returns false, open_join? returns false, existing join links still exist in the database but are unusable.
  • Pre-existing user follows a link (anti-drive-by-join). A parked session[:pending_join_token] only auto-joins a brand-new account created in the same signup. If the person who authenticates turns out to be an existing user (e.g. they follow the link logged out, then sign in, or link a new verified OAuth provider), they are not silently added. Instead a dismissible “You followed a link to join X — Join / Dismiss” banner renders (_pending_join_banner), driven by PendingJoinsController: POST /pending_join admits, DELETE /pending_join dismisses. Verify a lured-in token does not force-join an existing account.

Flow 5 — Identity surfaces

/workspaces — your workspaces

  1. Sign in and navigate to /workspaces (the account menu’s “All workspaces” item, the “All workspaces” row at the bottom of the workspace switcher’s menu, or directly by URL). Expect (desktop, ≥md): an identity anchor — your avatar and full name — above the “Your workspaces” heading and the “New workspace” button (present only while workspace creation is enabled). Below: the current workspace, if any, as a card marked “Current”; then Other workspaces, each card showing plan, your role, member count and last access, with a Switch button (a name filter appears once there are three or more); then Archived workspaces, each with a Restore button. Expect (phone, below md): the workspace switcher sits at the top of the column in its “All workspaces” state — your avatar and name over “All workspaces” — and the identity anchor does not render separately; the switcher carries it.
  2. With no memberships and nothing archived, the page shows an empty-state message (with a create action while creation is enabled) — not an error.

/settings — account settings

Navigate into the settings hub. The sidebar shows these items in personal context (always visible, no Pundit gating):

Sidebar label Path What it covers
Profile GET /settings/profile/edit Display name and email address.
Notifications GET /settings/notification_preferences/edit Per-channel and digest preferences.
Security GET /settings/connected_accounts Linked OAuth providers, verification status, resend, unlink.
Passkeys GET /settings/passkeys Add and remove passkeys.
Blocked senders GET /settings/invitation_blocks Inviters blocked with “Don’t invite me again”; unblock them here.
Active devices GET /settings/sessions Signed-in sessions; sign one out, or all the others.
Appearance GET /settings/theme_preference/edit Light / dark / system theme toggle.

Password. Only with AUTH_PASSWORDS=enabled: settings/password/new sets a first password and settings/password/edit changes or removes one. No sidebar item or settings page links to them, so open them by URL.

Timezone. Timezone is set automatically by a client beacon (settings/preferences/timezone). There is no manual timezone setting page.

Workspace switcher

The switcher (shared/_workspace_switcher.html.erb; trigger in shared/_workspace_switcher_trigger.html.erb) renders on every workspace page, solo users included — it is what names the workspace. Desktop (≥md): it heads the sidebar. Phone (below md): the sidebar is display:none, not absent, so a second copy renders in the content column above the Overview / Projects / Settings strip with every id suffixed -mobile; the hamburger holds global chrome only. Only the list of workspaces in the menu is gated on workspaces.size > 1.

  1. Sign in as a user with exactly one workspace and open any workspace page. Expect: one control — the workspace’s logo, its name and your role — at the top of the sidebar (desktop) or above the section tabs (phone). Opening it shows a menu whose only row is “All workspaces”.
  2. Join or create a second workspace (requires TENANCY_WORKSPACE_CREATION=enabled or an invitation), then reload. Expect: the menu lists your workspaces, the current one marked with a left border (border-l-4 border-interactive), a sunken background, semibold weight and aria-current; “All workspaces” is the last row, aligned with the names. On a phone the list pins the current workspace first and shows at most five, most recently accessed first — “All workspaces” is the overflow.
  3. Click another workspace. Expect: navigation to workspace_path(workspace); the control now names that workspace.
  4. Rename the workspace from its Settings › Profile page. Expect: the control updates in place — both copies on a phone — through a Turbo Stream that replaces the whole trigger (workspaces/update.turbo_stream.erb), never a piece of it.
  5. Navigate to /workspaces. Expect (phone): the control stays, in its “All workspaces” state (see Flow 5), and its menu marks “All workspaces” current. Desktop has no sidebar on this page; the identity anchor above the heading takes its place.

Edge cases — Identity

  • /workspaces requires authentication. Navigating to /workspaces when signed out triggers the authentication guard and redirects to the sign-in page.
  • Settings sidebar in org context. When the settings layout is loaded in the context of a workspace (e.g., /workspaces/:slug/edit), the sidebar shows workspace-scoped items (Profile, Members, Limits & Plan), gated by Pundit. Items for which the current user lacks the required permission are omitted — they are not shown as disabled.
  • Removing the last OAuth/email sign-in method. Settings::ConnectedAccountsController#destroy checks only_verified_remaining? before destroying. Attempting to remove the last verified authentication method shows the “cannot remove last verified” alert without deleting anything.

Flow 6 — Onboarding wizard (:none preset)

Config: WORKSPACE_ON_SIGNUP=none in .env and restart bin/dev. SIGNUP_MODE=open makes self-service sign-up easy for testing; invite-only also works.

The :none preset means new users are not automatically placed in a workspace at signup. Instead, RequiresOnboarding intercepts every page-navigation request for an unauthenticated-workspace user and funnels them through a short wizard. The wizard is handled by OnboardingsController (the entry dispatcher) and the Onboarding::* step controllers.

Sign up and reach the wizard

  1. In a private window navigate to /session/new and enter your email address.
  2. Click the registration magic link in /letter_opener, fill in your name, and submit. Expect: You are redirected to after_authentication_url (default: root_path). Because the :none preset is active and Current.user.onboarded? is false, RequiresOnboarding immediately redirects to /onboarding.

Wizard step 1 — Name your workspace

  1. OnboardingsController#show checks Current.user.onboarding_step and redirects to /onboarding/workspaces/new. Expect: A form asking for a workspace name.
  2. Fill in a name and submit (POST /onboarding/workspaces). Expect: The workspace is created and you are redirected to /onboarding/projects/new.

Wizard step 2 — Create your first project

  1. Expect: A form asking for a project name (and optional description).
  2. Fill in a name and submit (POST /onboarding/projects). Expect: The project is created. Onboarding::ProjectsController#create checks ProjectTools::Registry.toggleable.size. If only one tool is registered (the default — just :docs), you skip the tools step and are redirected directly to /onboarding/teams/new. If more than one toggleable tool exists you are redirected to /onboarding/tools/new first.

Wizard step 3 (conditional) — Choose tools

This step only appears when the registry has more than one toggleable tool.

  1. Expect: A list of toggleable project tools with checkboxes.
  2. Select the tools you want and submit (POST /onboarding/tools). Expect: The project’s enabled_tools are updated and you are redirected to /onboarding/teams/new.

Wizard step 4 — Invite people (or skip)

  1. Expect: A form to invite teammates by email. A “Skip for now” link (PATCH /onboarding) is present.
  2. Either enter one or more email addresses (comma- or newline-separated), choose a role, and submit (POST /onboarding/teams) — or click Skip for now.
    • Invites sent: Invitation.bulk_invite! dispatches invitation emails. Check /letter_opener. Current.user.onboarded_at is set and you are redirected to workspace_project_path for the new project.
    • Skipped: OnboardingsController#update sets onboarded_at and redirects to workspace_project_path (or workspace_path if no project exists, or root_path as a final fallback). Expect: You land on the project home page. The onboarding gate no longer fires — Current.user.onboarded? is now true.

Edge cases — Onboarding

  • Resuming mid-wizard. If a user navigates away mid-wizard and returns later, OnboardingsController#show dispatches them to their derived onboarding_step (:workspace, :project, or :team) based on what already exists.
  • Client users bypass the wizard. Clientside::BaseController calls skip_onboarding_requirement, so a client user with no workspace lands directly in the client area — not the onboarding wizard.
  • Non-HTML requests pass through. The RequiresOnboarding guard only redirects request.format.html? requests. Background XHR/JSON requests (e.g. the timezone beacon) are not interrupted.

Flow 7 — Client invite → accept → client area

Config: WORKSPACE_ON_SIGNUP=none or any preset. Clientside is enabled per project, not per deployment. The workspace must have at least one project.

Enable Clientside for the project

  1. Sign in as a workspace owner or manager.
  2. Navigate to the project settings: /workspaces/:slug/projects/:project_slug/clientside/edit. Expect: A Clientside settings form with an enable/disable toggle.
  3. Enable Clientside and save (PATCH /workspaces/:slug/projects/:project_slug/clientside). Expect: project.clientside_enabled? is now true. The project’s Clientside settings page carries an Invite a client link to the client invitation form. The page, and the link to it on the project page, are for the project’s creator and for workspace roles that can manage members (Owner, Admin).

Invite a client

  1. From the Clientside settings page, navigate to the new client invitation form: /workspaces/:slug/projects/:project_slug/client_invitations/new. Expect: A form with one field, the client’s email address.
  2. Fill in the fields and submit (POST /workspaces/:slug/projects/:project_slug/client_invitations). Workspaces::Projects::ClientInvitationsController#create calls Invitation.invite_client!(project:, email:, invited_by: Current.user), which creates a client-type Invitation and dispatches an invitation email via InvitationMailer.with(invitation:).invite_client. Expect: You are redirected back to the Clientside settings page with a “sent” notice. Check /letter_opener for the invitation email.

Existing user accepts

  1. In a private window, sign in as the invited user (or be already signed in as them).
  2. Open the invitation email in /letter_opener and click View the invitation (GET /invitations/:token/accept). Expect: The accept page (InvitationAcceptsController#show) renders — a confirmation prompt showing the project they are being invited to.
  3. Click Accept invitation (POST /invitations/:token/accept). InvitationAcceptsController#create calls Invitation.consume!, which calls Invitation#accept_client_invitation!. This creates a ClientAccess row for the user scoped to the project. Expect: You are redirected to clientside_project_path(@invitation.invitable) with a success notice — the client area for that project.

New user accepts

  1. In a private window with no session, open the invitation email and click View the invitation. Expect: InvitationAcceptsController#show renders. The token is stashed in session[:pending_invitation_token]. A prompt to register or sign in is shown.
  2. Navigate to /session/new, enter the invited email address, click the registration magic link in /letter_opener, fill in your name, and submit (the session token satisfies signups_open? even under invite_only).
  3. Expect: You are signed in. The email is verified inside the registration transaction. commit_signup_atomically claims the session’s invitation through PendingClaims and a ClientAccess is created. Under WORKSPACE_ON_SIGNUP=none you are redirected to the client area; a preset that gives the new account a workspace lands it on root_path instead.

Client area — what the client sees

Once in the client area the client user sees only their accessible projects (clientside_projects_path). Within a project they can view resources in Project#client_visible_resources (Clientside::Projects::ResourcesController#show). They cannot reach any workspace-scoped routes — Clientside::BaseController resolves projects exclusively through Current.user.client_accesses.kept, not through workspace membership.

Edge cases — Client invite

  • Clientside disabled. Workspaces::Projects::ClientInvitationsController guards every action with ensure_clientside_enabled. Attempting to invite a client when Clientside is off redirects to the Clientside settings page with an alert.
  • Duplicate invite. Invitation.invite_client! raises ActiveRecord::RecordNotUnique if the email already has a pending invitation for the same project. The controller rescues and re-renders the form with an “already invited” alert.
  • Clientside disabled after ClientAccess created. If a manager disables Clientside on a project after clients have been granted access, Clientside::BaseController#ensure_clientside_enabled redirects clients to clientside_projects_path with an “unavailable” alert when they try to enter that project’s area. Their ClientAccess row is preserved; re-enabling Clientside restores their access immediately.

Flow 8 — Passkeys (WebAuthn)

Manual QA (requires a secure context)

Passkeys need a secure context; where the page is not one, the “Sign in with a passkey” button feature-detects off and the page falls back to magic link. Chrome treats plain http://localhost as secure (the passkey system specs run there), and the default development origin is http://localhost:3000, so no TLS is needed:

  1. Run bin/dev and open http://localhost:3000 in Chrome. For browsers that need a real HTTPS origin, see Passkeys.
  2. Sign in (magic link) → Settings → Passkeys → Add a passkey → approve the platform prompt → the credential appears in the list.
  3. Sign out → on the sign-in screen tap Sign in with a passkey → approve → signed in.
  4. Remove the passkey in Settings → confirm sign-in still works via magic link.

See Passkeys for RP-ID/origin configuration and troubleshooting.

Writing passkey tests (contributors)

WebAuthn can’t be driven by a normal Capybara click, so tests use one of two real-crypto harnesses (no mocking the gem):

  • Request specs use the gem’s WebAuthn::FakeClient (real attestation / assertion crypto). See spec/lib/passkeys/*_spec.rb and spec/requests/passkeys/*_spec.rb.
  • System specs use a Cuprite (Ferrum) CDP virtual authenticator, set up by spec/support/webauthn_virtual_authenticator.rb (page.driver.browser → raw CDP via browser.page.command → WebAuthn.enable + WebAuthn.addVirtualAuthenticator). The example lives in spec/system/passkey_auth_spec.rb. Note: the virtual authenticator requires Capybara.app_host to match the configured RP origin.

Flow 9 — Instance operations

Config: any preset. Two accounts: an operator and a plain member; keep the member in a private window. Background: Instance operations.

Bootstrap the operator

  1. Make sure the operator’s account exists (sign up, the console one-liner in the runbook, or the :shared seed), then:

    bin/rails 'operators:grant[op@example.com]'
    bin/rails 'tenancy:owner_setup_link[op@example.com]'
    

    Expect: the grant reports success; running it again reports they are already an operator. The setup link is printed to the terminal, never emailed. Open it, confirm → signed in → /settings/password/new with AUTH_PASSWORDS=enabled, otherwise the home page. With passwords on, set one within 15 minutes: the area re-checks reauthentication on every request, and a passwordless account’s only other factor is an emailed code.

  2. As the member, navigate to /operations, /operations/users, /operations/operatorships. Expect: a plain 404 each time — not 403, not a redirect. No link to the area exists anywhere for a member.

  3. As the operator, navigate to /operations. Expect: the banner “Instance operations — you are above the workspaces, not inside one.” and a nav of Workspaces · Users · Activity · Operators. Every workspace on the instance is listed — locked and archived ones included — sorted case-insensitively, each name linking to its page.

Create a workspace for an owner

  1. Workspaces → New workspace. Name it, set Owner’s email address to the member’s address → Create workspace. Expect: “Workspace created.”; the workspace page lists the member as Owner; the operator is not a member of it.
  2. Repeat with an address nobody has an account for. Expect: the operator is the Owner for now; /letter_opener holds an Owner-role invitation to that address. Accept it in a private window → the new person is an Owner too; the operator stays a member until they hand off (Members → Leave). This is deliberate — see The operator becomes the owner.
  3. Submit with the owner email blank, then with not-an-email. Expect: the form re-renders with the error on the Owner’s email address field, the submitted value still in it, and no workspace created.

Lock and unlock a workspace

  1. Open a workspace → Lock this workspace → confirm (“Everyone in it is blocked until you unlock it. Nothing is deleted.”). Expect: “Workspace locked.”; the status badge reads Locked; the button is now Unlock this workspace.
  2. As the member, open that workspace. Expect: “This workspace is locked.” — every page in it is blocked.
  3. Unlock it, then as the member open the workspace’s activity. Expect: rows naming the operator: “locked the workspace” and “unlocked the workspace”. Lock it twice in quick succession (double-submit) → exactly one “locked” row.

Look a user up, suspend, reinstate

  1. Users → enter the member’s exact email address (any case) → Search. Expect: one result linking to their page. A wrong address → “No user matches that name or address.” Without a query the page lists every account, newest first; part of a name also matches.
  2. On the member’s page: Suspend → confirm (“This ends their sessions and blocks sign-in until you reinstate them. Their workspaces and roles stay as they are.”). Expect: “Access suspended.”; a Suspended badge with “since …” in your own time zone; Reinstate where Suspend was; the memberships list below is unchanged.
  3. As the member: their existing tab now redirects to sign-in (the session was ended). Sign in with the password (with AUTH_PASSWORDS=enabled). Expect: “Your account has been suspended. Contact whoever runs this app to have it reinstated.” Request a magic link and open it → the same refusal. Passkey and OAuth sign-in are refused the same way.
  4. Operator: Reinstate. Expect: “Access reinstated.” The member signs in normally and every workspace and role is exactly as it was.
  5. Open the page of any operator, your own included. Expect: an Operator badge, no Suspend button, and “Operators can’t be suspended. Revoke their operator access first.” with “operator access” linking to the roster.

Clear a sign-in lockout

Config: AUTH_PASSWORDS=enabled.

  1. As the member, enter a wrong password five times. Expect: “Invalid email or password.” every time, the fifth included: the page never says an account is locked (Flow 2). The member gets a “password sign-in is paused” email.
  2. Operator: open the member’s page. Expect: “Sign-in blocked after 5 failed attempts — clears in about 1 hour.” and Let them try again. Click it → “Lockout cleared.”; the sentence is gone; the member can sign in at once.

Operators

  1. Operators → Grant operator access to (email) = the member → Grant. Expect: “Operator access granted.”; the roster shows them “granted by you on date” (a rake or seed grant shows “rake or seed”). Grant again → “That user is already an operator.” An unknown address → “No user has that email address.” Blank → “Enter an email address.”
  2. With two operators on the roster, Revoke your own row. Expect: “You cannot revoke your own operator access. Ask another operator to do it.” Revoke the member instead → confirm (“Revoke name’s operator access?”) → “Operator access revoked.” Now, as the only operator left, revoke yourself → “The last operator cannot be revoked from here. Use rails operators:revoke on the server.”
  3. Activity. Expect: newest first: the grant and revoke rows (“granted name operator access”, “revoked name’s operator access”), the suspension and reinstatement, the lock and unlock — each naming the operator. Personal security events (password changes, passkeys, new devices) never appear here.

Edge cases — Operations

  • TENANCY_WORKSPACE_CREATION=disabled: the Workspaces index shows no New workspace; /operations/workspaces/new redirects with “Workspace creation is disabled on this instance.”; a member still gets 404.
  • Break-glass: rails 'users:suspend[op@example.com]' suspends an operator (the panel refuses; the task does not check) and rails users:unsuspend restores them; rails 'operators:revoke[email]' revokes even the last operator.
  • Reauthentication: sign in, wait 15 minutes, open /operations → the reauthentication interstitial (an emailed code, a passkey if you have one, or your password when AUTH_PASSWORDS=enabled), then the page.
  • AAA: every operations page is audited in both themes by spec/system/operations_area_spec.rb; when checking by hand, switch theme and re-read a page with the pointer resting on a list row.