Skip to content

Commit 700233e

Browse files
authored
Merge pull request #303 from andyw8/andyw8/add-guideance-for-controller-testing
Add guidance for controller testing
2 parents 34eb3d2 + 6062dcc commit 700233e

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
@@ -1738,6 +1738,23 @@ Bundler.require(platform)
17381738
Do not remove the `Gemfile.lock` from version control.
17391739
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`.
17401740

1741+
== Testing
1742+
1743+
=== Integration Testing
1744+
1745+
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].
1746+
1747+
[source,ruby]
1748+
----
1749+
# bad
1750+
class MyControllerTest < ActionController::TestCase
1751+
end
1752+
1753+
# good
1754+
class MyControllerTest < ActionDispatch::IntegrationTest
1755+
end
1756+
----
1757+
17411758
== Managing Processes
17421759

17431760
=== Foreman [[foreman]]

0 commit comments

Comments
 (0)