Class | Tests::PretendController |
In: |
app/controllers/tests/pretend_controller.rb
|
Parent: | ApplicationController |
This class exists to provide a test for including page behavior in controllers. I didn‘t know of a way to add functional tests for controllers/routes that aren‘t in the apps directory.
This should be moved to the test directory if possible.
RESTRICTED_H1 | = | "Restricted" |
# File app/controllers/tests/pretend_controller.rb, line 21 21: def error 22: raise StandardError 23: end
# File app/controllers/tests/pretend_controller.rb, line 25 25: def not_found 26: raise ActiveRecord::RecordNotFound.new("This thing was missing!") 27: end
# File app/controllers/tests/pretend_controller.rb, line 17 17: def open 18: render :text =>"<h1>Open Page</h1> You can see this public page." 19: end
# File app/controllers/tests/pretend_controller.rb, line 29 29: def open_with_layout 30: render :layout=>"templates/subpage" 31: end