一键导入
testing
Write and maintain Minitest tests with fixtures, SimpleCov coverage, Capybara system tests, and WebMock
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write and maintain Minitest tests with fixtures, SimpleCov coverage, Capybara system tests, and WebMock
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create and manage Solid Queue background jobs with perform_now vs perform_later patterns
Perform deep critical analysis of changes with focus on performance vs sustainability trade-offs
Add controllers and routes following project patterns for organizer namespaces, strong params, and Turbo
Build Rails forms with Tailwind CSS, Turbo integration, and strong params validation
Write database migrations for PostgreSQL with PostGIS, UUID primary keys, enums, and counter caches
Create and modify Rails models following project conventions for STI, enums, validations, counter caches, and scopes
| name | testing |
| description | Write and maintain Minitest tests with fixtures, SimpleCov coverage, Capybara system tests, and WebMock |
| license | MIT |
test/fixtures/*.yml with STI type handlingtest/
models/ — unit tests for models
services/ — unit tests for service objects
controllers/ — controller tests (JSON + request)
jobs/ — background job tests
system/ — Capybara system tests
integration/ — multi-controller flow tests
fixtures/ — YAML fixtures
test_helper.rb — SimpleCov + parallel workers + fixtures :all
fixtures :all — always load all fixturesparallelize(workers: :number_of_processors) — parallel test executionEvent.reset_counters in setup block — counter cache consistencyWebMock.disable_net_connect!(allow_localhost: true) — block external HTTPcommand_name for parallel coverage mergingassert_not / assert patternsassert_not_nil / assert_equalassert_equal expected, Model.scopetype: "Tournament" in fixturesfixtures :all then reference by key: players(:player_one)type: "Tournament" fieldevent_participants_count: 4state: 3 (not :swiss)<%= 1.week.from_now %>standard_tournament, small_tournament_swissApplicationSystemTestCase → Selenium/Firefox, 1920x1080fill_in "session_email_address", with: "user@example.com"click_button "Sign in", click_link "Logout"assert_current_path, assert_text, assert_no_text, assert_fieldsign_in_as(user)assert_current_path new_session_path#method! (bang) methods with assert_not_raiseSimpleCov.start "rails" in test_helper.rb/bin/, /db/, /test/ directoriescoverage/ directorybin/rails test to regeneratetest/test_helper.rb — Test setup, SimpleCov, fixtures, parallel workerstest/application_system_test_case.rb — System test base (Selenium/Firefox)test/fixtures/events.yml — Example fixture file with STI + enums + counter cachestest/system/authentication_test.rb — Example system test with sign-in flowtest/services/scoring/point_wager_test.rb — Example service test