← スキル一覧に戻る

wheels-test-generator
by wheels-dev
wheels-test-generatorは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 200🍴 106📅 2026年1月23日
SKILL.md
name: Wheels Test Generator description: Generate TestBox BDD test specs for Wheels models, controllers, and integration tests. Use when creating tests for models (validations, associations), controllers (actions, filters), or integration workflows. Ensures comprehensive test coverage with proper setup/teardown and Wheels testing conventions.
Wheels Test Generator
When to Use This Skill
Activate automatically when:
- User requests to create tests/specs
- User wants to test a model, controller, or workflow
- User mentions: test, spec, TestBox, BDD, describe, it, expect
- After generating models/controllers (proactive testing)
Model Test Template
component extends="wheels.Test" {
function setup() {
// Runs before each test
super.setup();
model = model("Post").new();
}
function teardown() {
// Runs after each test
if (isObject(model) && model.isPersisted()) {
model.delete();
}
super.teardown();
}
function testValidatesPresenceOfTitle() {
model.title = "";
assert("!model.valid()");
assert("model.hasErrors('title')");
}
function testHasManyComments() {
model = model("Post").create(title="Test", content="Content");
comment = model("Comment").create(postId=model.id, content="Comment");
assert("model.comments().recordCount == 1");
model.delete(); // Cascade should delete comment
assert("!isObject(model('Comment').findByKey(comment.id))");
}
}
Controller Test Template
component extends="wheels.Test" {
function setup() {
super.setup();
params = {controller="posts", action="index"};
}
function testIndexLoadsAllPosts() {
controller = controller("Posts", params);
controller.processAction("index");
assert("isQuery(controller.posts)");
}
function testShowRequiresKey() {
params.action = "show";
controller = controller("Posts", params);
// Should redirect due to missing key
}
function testCreateWithValidData() {
params.action = "create";
params.post = {title="Test", content="Content"};
controller = controller("Posts", params);
controller.processAction("create");
assert("flashKeyExists('success')");
}
}
Integration Test Template
component extends="wheels.Test" {
function testCompletePostLifecycle() {
// Create
post = model("Post").create(title="Test", content="Content");
assert("isObject(post) && post.isPersisted()");
// Update
post.update(title="Updated");
assert("post.title == 'Updated'");
// Add comment
comment = model("Comment").create(postId=post.id, content="Comment");
assert("post.comments().recordCount == 1");
// Delete (cascade)
post.delete();
assert("!isObject(model('Comment').findByKey(comment.id))");
}
}
Related Skills
- wheels-model-generator: Creates models to test
- wheels-controller-generator: Creates controllers to test
Generated by: Wheels Test Generator Skill v1.0
スコア
総合スコア
75/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
3ヶ月以内に更新
+5
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です
