Skip to content

Files

Latest commit

 

History

History
32 lines (22 loc) · 765 Bytes

Rails-ActionControllerTestCase.md

File metadata and controls

32 lines (22 loc) · 765 Bytes

Pattern: Use of ActionController::TestCase

Issue: -

Description

Using ActionController::TestCase is discouraged and should be replaced by ActionDispatch::IntegrationTest. Controller tests are too close to the internals of a controller whereas integration tests mimic the browser/user.

Examples

# bad
class MyControllerTest < ActionController::TestCase
end

# good
class MyControllerTest < ActionDispatch::IntegrationTest
end

Configurable attributes

Name Default value Configurable values
SafeAutocorrect false Boolean
Include +**/test/**/*.rb+ Array

Further Reading