Skip to content

Commit 6062dcc

Browse files
committed
Add guidance for controller testing
1 parent 8d88cb6 commit 6062dcc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,23 @@ Bundler.require(platform)
17361736
Do not remove the `Gemfile.lock` from version control.
17371737
This is not some randomly generated file - it makes sure that all of your team members get the same gem versions when they do a `bundle install`.
17381738

1739+
== Testing
1740+
1741+
=== Integration Testing
1742+
1743+
Prefer integration style controller tests over functional style controller tests, https://api.rubyonrails.org/v7.0.0/classes/ActionController/TestCase.html[as recommended in the Rails documentation].
1744+
1745+
[source,ruby]
1746+
----
1747+
# bad
1748+
class MyControllerTest < ActionController::TestCase
1749+
end
1750+
1751+
# good
1752+
class MyControllerTest < ActionDispatch::IntegrationTest
1753+
end
1754+
----
1755+
17391756
== Managing Processes
17401757

17411758
=== Foreman [[foreman]]

0 commit comments

Comments
 (0)