Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rails 6.0.2.3 - test failure out-of-the-box
# Rails 6.0.2.3
# 'Behavior' = std Rails scaffold with one name:string attribute.
# rails db:migrate = no problem.
# rails test = 2 fails below. other controllers (~60, identical except for object name) pass.
Error:
BehaviorsControllerTest#test_should_destroy_behavior:
NoMethodError: undefined method `count' for ActionDispatch::IntegrationTest::Behavior:Module
test/controllers/behaviors_controller_test.rb:42:in `block in <class:BehaviorsControllerTest>'
test/controllers/behaviors_controller_test.rb:42:in `block in <class:BehaviorsControllerTest>'
Error:
BehaviorsControllerTest#test_should_create_behavior:
NoMethodError: undefined method `count' for ActionDispatch::IntegrationTest::Behavior:Module
test/controllers/behaviors_controller_test.rb:19:in `block in <class:BehaviorsControllerTest>'
test/controllers/behaviors_controller_test.rb:19:in `block in <class:BehaviorsControllerTest>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment