app/controllers/limericks_controller.rb
file to add a syntax error to the LimericksController#index
method as follows.class LimericksController < ApplicationController
before_action :authenticate_user!, except: [:index]
before_action :require_permission, except: [:index, :new, :create]
def index
@limericks = Limerick.all.reverse_order
renxxxxxxder :index
end
...
render
is now an invalid call to a undefined method renxxxxxxder
.
rails test -v
Running 1 tests in a single process (parallelization threshold is 50)
Run options: -v --seed 61993
# Running:
LimericksControllerTest#test_should_get_index = 0.15 s = E
Error:
LimericksControllerTest#test_should_get_index:
NoMethodError: undefined method `renxxxxxxder' for #<LimericksController:0x0000000000d1d8>
renxxxxxxder :index
^^^^^^^^^^^^
app/controllers/limericks_controller.rb:8:in `index'
test/controllers/limericks_controller_test.rb:6:in `block in <class:LimericksControllerTest>'
rails test test/controllers/limericks_controller_test.rb:4
Finished in 0.153665s, 6.5077 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
NoMethodError: undefined method \
renxxxxxxder'") and that the file and line number where the bug was made is also mentioned ("
app/controllers/limericks_controller.rb:8:in `index’`”).assert
call).