Logo di Rails Testing

Rails Testing

Community
marckohlbrugge
rails-testing

Apply Rails testing standards with Minitest, fixtures, and pragmatic coverage boundaries. Use when creating tests, reviewing test quality, or improving flaky and slow Rails test suites.

Add to TypingMind

Panoramica

Pubblicato damarckohlbrugge
Repository37signals-skills
Nome della skillrails-testing
Stelle
724
Fork
56
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da marckohlbrugge su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Rails Testing in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/marckohlbrugge/37signals-skills/tree/main/skills/rails-testing
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/marckohlbrugge/37signals-skills.git /tmp/37signals-skills
mkdir -p .claude/skills
cp -r /tmp/37signals-skills/skills/rails-testing .claude/skills/rails-testing
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Rails Testing in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Rails Testing non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Rails Testing non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Rails Testing

Use for test-writing and test-review tasks. Patterns from Campfire and Fizzy test suites.

Defaults

  • Minitest + fixtures. No RSpec, no FactoryBot.
  • Test behavior, not implementation details.
  • Keep tests deterministic and fast; parallelize(workers: :number_of_processors).
  • Tests ship in the same commit/PR as the feature — not before, not later. Security fixes always include a regression test.
  • Never add production complexity for testability (no test-induced design damage).

Coverage Budget (where 37signals actually spends)

  • Heavy: model tests (domain invariants, concerns) and controller/integration tests (full request cycle, auth, formats).
  • Light: a few system tests for the critical happy paths (one smoke test can cover signup→use); job tests only for jobs with real logic.
  • None: view tests, JS/Stimulus unit tests, exhaustive channel tests. UI behavior is covered indirectly by system tests.
  • Don't duplicate the same behavior assertion at multiple layers.

Fixtures

  • Express relationships by label, not ID; use ERB for relative timestamps (created_at: <%= 1.hour.ago %>) and shared computed values (one bcrypt digest reused).
  • Mirror app/models structure in test/models: app/models/card/closeable.rb ↔ test/models/card/closeable_test.rb; shared concerns under test/models/concerns/.
  • UUID PKs break fixture ordering: generate deterministic, label-derived UUIDv7s in fixtures so .first/.last are stable and runtime records are always newer.
  • Build rich-content fixtures with production code (ActionText::Attachment.from_attachable(user).to_html), not hand-written markup.

Good Practices

  • Use system/integration tests for user workflows; model tests for domain invariants.
  • travel_to for time-based logic.
  • Mock/stub only at boundaries (external APIs, network, time, SecureRandom); use VCR for external HTTP — auto-name cassettes from class+test name, normalize timestamps in matching.
  • Test async side effects from model tests with perform_enqueued_jobs(only: SpecificJob) and assert_enqueued_with — not by unit-testing trivial job classes.
  • Correlated count changes in one assertion: assert_difference({ -> { card.assignees.count } => -1, -> { Event.count } => +1 }).
  • Test both response formats where controllers serve them: as: :turbo_stream (assert stream targets) and as: :json (status, Location header, body).
  • Turbo/broadcast assertions by layer: assert_turbo_stream_broadcasts in model tests, assert_turbo_stream action:, target: in controller tests, assert_no_turbo_stream_broadcasts for negatives.
  • Authorization tests assert the negative space: cross-tenant/role access returns 403/404, not just that allowed access works.
  • Multi-tenant suites: set Current.account (and Current.session when behavior depends on the actor) in setup; integration/system tests set default_url_options[:script_name]; provide an untenanted { } helper for auth routes. Clear Current in teardown.
  • Test middleware in isolation with Rack::MockRequest.
  • System tests: using_session("Kevin") for multi-user scenarios; wait for cable connection before asserting realtime; auth via a fast session-transfer helper, keeping the full login flow to one smoke test.
  • Suites with non-transactional side effects (FTS tables) opt out per-helper: self.use_transactional_tests = false + explicit cleanup.
  • Reset shared global state per test in parallel suites (thread pools, ActionCable.server.pubsub, Current).

Red Flags

  • Adding production complexity only for testability.
  • Over-mocking internal app code.
  • Duplicate tests for the same behavior at multiple layers.
  • Slow suites caused by unnecessary setup in each test (that's what fixtures are for).
  • Unit tests for one-line job classes or trivial delegations.
  • Hand-rolled HTML strings where production renderers/helpers would stay in sync automatically.
  • Time-dependent assertions without travel_to.

Domande frequenti

Cosa fa la skill IA Rails Testing?

Apply Rails testing standards with Minitest, fixtures, and pragmatic coverage boundaries. Use when creating tests, reviewing test quality, or improving flaky and slow Rails test suites.

Perché usare Rails Testing su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Rails Testing è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Rails Testing in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/marckohlbrugge/37signals-skills/tree/main/skills/rails-testing. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Rails Testing?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Rails Testing?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Rails Testing: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Rails Testing è gratuita?

È pubblicata su GitHub da marckohlbrugge. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇