4 class FunctionalExample < RailsExample
5 include ActionController::TestProcess
6 include ActionController::Assertions
8 attr_reader :request, :response
10 @controller_class = Object.path2class @controller_class_name
11 raise "Can't determine controller class for #{@controller_class_name}" if @controller_class.nil?
13 @controller = @controller_class.new
15 @request = ActionController::TestRequest.new
16 @response = ActionController::TestResponse.new
34 # Hash of instance variables to values that are made available to views.
37 # #in thing_controller.rb
42 # #in thing_controller_spec
44 # assigns[:registration].should == Thing.new
46 # NOTE - Even though docs say only use assigns[:key] format, but allowing assigns(:key)
47 # in order to avoid breaking old specs.
49 def assigns(key = nil)
52 _controller_ivar_proxy
54 @controller.assigns[key]
55 _controller_ivar_proxy[key]
60 def _controller_ivar_proxy
61 @controller_ivar_proxy ||= IvarProxy.new @controller