mirror of https://github.com/docusealco/docuseal
fix: add team factory for RSpec (221 failures → 0) (#12)
* fix: add team factory and associate with user factory The Teams feature added a NOT NULL team_id constraint on users. The user factory was missing this association, causing 221/230 spec failures. * fix: make local CI match GitHub Actions 1:1 - Dockerfile.ci: add chromium, chromedriver, pdfium (same as remote CI) - docker-compose.ci.yml: fix PG18 tmpfs mount path (/var/lib/postgresql) - .githooks/pre-push: run FULL CI suite (lint + brakeman + rspec) Local CI results: 230 examples, 2 failures (system spec browser issues, pre-existing — same tests fail on remote CI too) * fix: resolve failing RSpec tests (setup + signing form) - setup_spec.rb:28: move team assignment before @account.valid? check to prevent cascading validation failure from missing team association - signing_form_spec.rb:1151: fix race condition by waiting for page content before asserting job enqueue; correct expected message text - db/schema.rb: update to reflect teams migrations * fix: resolve remaining flaky test failures - dashboard_spec.rb: use deterministic template name to prevent Faker::Book.title collisions between account templates - rails_helper.rb: increase Cuprite timeout from 20s to 30s to prevent PendingConnectionsError on first page load in CI --------- Co-authored-by: Sebastian Noe <sebastian.schneider@boxine.de>pull/681/head
parent
3fe82a0f66
commit
37f449a69f
@ -1,14 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Pre-push hook: runs linting via Docker before pushing to GitHub.
|
||||
# Ensures Rubocop, ERBLint, and ESLint pass locally.
|
||||
# Pre-push hook: runs the FULL CI suite via Docker before pushing to GitHub.
|
||||
# Mirrors GitHub Actions exactly: Rubocop, ERBLint, ESLint, Brakeman, RSpec.
|
||||
# Skip with: git push --no-verify
|
||||
#
|
||||
# Enable this hook: git config core.hooksPath .githooks
|
||||
set -e
|
||||
|
||||
echo "🔍 Running lint checks before push..."
|
||||
echo "🔍 Running full CI suite before push..."
|
||||
|
||||
docker compose -f docker-compose.ci.yml build lint --quiet 2>/dev/null
|
||||
docker compose -f docker-compose.ci.yml build --quiet 2>/dev/null
|
||||
|
||||
echo "━━━ Lint (Rubocop + ERBLint + ESLint) ━━━"
|
||||
docker compose -f docker-compose.ci.yml run --rm --no-deps lint
|
||||
|
||||
echo "✅ All lint checks passed."
|
||||
echo ""
|
||||
echo "━━━ Brakeman (Security) ━━━"
|
||||
docker compose -f docker-compose.ci.yml run --rm --no-deps brakeman
|
||||
|
||||
echo ""
|
||||
echo "━━━ RSpec ━━━"
|
||||
docker compose -f docker-compose.ci.yml run --rm rspec
|
||||
|
||||
docker compose -f docker-compose.ci.yml down --volumes 2>/dev/null
|
||||
|
||||
echo ""
|
||||
echo "✅ Full CI suite passed. Push allowed."
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :team do
|
||||
account
|
||||
name { Faker::Team.name }
|
||||
end
|
||||
end
|
||||
Loading…
Reference in new issue