Performance: Integration tests
Integration tests affect the overall test suite runtime and can impact developer feedback speed during development.
test 'user login flow', :focus do post login_path, params: { email: 'user@example.com', password: 'password' } assert_redirected_to dashboard_path end
test 'user login flow' do visit login_path fill_in 'Email', with: 'user@example.com' fill_in 'Password', with: 'password' click_button 'Log in' assert_text 'Welcome' end
| Pattern | Test Runtime | Resource Usage | Developer Feedback | Verdict |
|---|---|---|---|---|
| Full browser integration test | High (seconds per test) | High (browser + DB) | Slow feedback | [X] Bad |
| Request-level integration test | Low (milliseconds) | Low (DB only) | Fast feedback | [OK] Good |
test "visit home page" do get root_path assert_response :success assert_select "h1", "Welcome" end
assert_select "h1", "Welcome" check?test "create user" do
post users_path, params: { user: { name: "Alice" } }
assert_redirected_to user_path(@user)
endPass the test and this pattern moves unknown