一键导入
rspec-testing
RSpec testing patterns, conventions, and test commands for this Rails codebase
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
RSpec testing patterns, conventions, and test commands for this Rails codebase
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create, execute, update, and complete implementation plans and trackers following Linkvan API conventions
Standardized Ruby gem update workflow with version checking, breaking change analysis, security advisory detection, and testing
Controller patterns, service delegation, strong parameters, and HTTP conventions for this Rails codebase
RuboCop metrics, Brakeman security, code style conventions, and quality checks for this Rails codebase
Database migration patterns, reversible migrations, indexes, and conventions for this Rails codebase
ActiveRecord model patterns, validations, scopes, and conventions for this Rails codebase
| name | rspec-testing |
| description | RSpec testing patterns, conventions, and test commands for this Rails codebase |
bin/rspec # Run all tests
bin/rspec spec/models/facility_spec.rb # Run single test file
bin/rspec spec/models/facility_spec.rb:42 # Run specific test by line
bin/rspec spec/models/facility_spec.rb -e "validates name presence" # Run by description
bin/rspec spec/models/ # All model specs
bin/rspec spec/services/facility_serializer_spec.rb # Specific service spec
describe for context and it for examplesexpect(x).to eq(y) over expect(x) == ylet for lazy evaluation, let! for immediatesubject for the main object being testedit_behaves_like for repeated patterns*_spec.rb suffix (e.g., facility_spec.rb)spec/models/ - Model testsspec/services/ - Service testsspec/controllers/ - Controller teststype: :componentRSpec.describe Facility do
subject(:facility) { create(:facility, :with_verified) }
describe "#managed_by?" do
it "returns true for admin users" do
expect(facility.managed_by?(admin_user)).to be true
end
end
end
factory :name (e.g., factory :facility):trait_name syntax (e.g., :with_verified)bin/rspec