Performance: Controller tests
MEDIUM IMPACT
Controller tests impact development speed and test suite runtime, affecting how quickly developers get feedback.
test "index action returns success" do get :index, params: { format: :json } assert_response :success assert_includes @response.content_type, 'application/json' end
test "index action" do get :index assert_response :success assert_not_nil assigns(:items) assert_select 'div.item', minimum: 1 end
| Pattern | Database Queries | View Rendering | Test Runtime | Verdict |
|---|---|---|---|---|
| Full controller test with view rendering | Multiple queries | Full rendering | Slow (100+ ms) | [X] Bad |
| Controller test with JSON response and mocks | Minimal queries | No rendering | Fast (30 ms) | [OK] Good |