Class: ControllerSpecController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ControllerSpecController
show all
- Defined in:
- lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb
Defined Under Namespace
Classes: RescuedError, UnRescuedError
Instance Method Summary
collapse
Instance Method Details
#action_setting_flash_after_session_reset ⇒ Object
67
68
69
70
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 67
def action_setting_flash_after_session_reset
reset_session
flash[:after_reset] = "available"
end
|
#action_setting_flash_before_session_reset ⇒ Object
72
73
74
75
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 72
def action_setting_flash_before_session_reset
flash[:before_reset] = 'available'
reset_session
end
|
#action_setting_the_assigns_hash ⇒ Object
63
64
65
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 63
def action_setting_the_assigns_hash
@indirect_assigns_key = :indirect_assigns_key_value
end
|
#action_that_assigns_false_to_a_variable ⇒ Object
92
93
94
95
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 92
def action_that_assigns_false_to_a_variable
@a_variable = false
render :text => ""
end
|
#action_that_renders_inline ⇒ Object
88
89
90
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 88
def action_that_renders_inline
render :inline => "<%= 'inline code' %>"
end
|
118
119
120
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 118
def
render :text => request.[params[:header]]
end
|
#action_which_gets_cookie ⇒ Object
37
38
39
40
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 37
def action_which_gets_cookie
raise "expected #{params[:expected].inspect}, got #{cookies[:cookie_key].inspect}" unless (cookies[:cookie_key] == params[:expected])
render :text => ""
end
|
#action_which_gets_session ⇒ Object
28
29
30
31
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 28
def action_which_gets_session
raise "expected #{params[:session_key].inspect}\ngot #{session[:session_key].inspect}" unless (session[:session_key] == params[:expected])
render :text => ""
end
|
#action_which_sets_cookie ⇒ Object
42
43
44
45
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 42
def action_which_sets_cookie
cookies['cookie_key'] = params[:value]
render :text => ""
end
|
#action_which_sets_flash ⇒ Object
23
24
25
26
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 23
def action_which_sets_flash
flash[:flash_key] = "flash value"
render :text => ""
end
|
#action_which_sets_session ⇒ Object
33
34
35
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 33
def action_which_sets_session
session[:session_key] = "session value"
end
|
#action_with_errors_in_template ⇒ Object
59
60
61
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 59
def action_with_errors_in_template
render :template => "controller_spec/action_with_errors_in_template"
end
|
#action_with_partial ⇒ Object
47
48
49
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 47
def action_with_partial
render :partial => "controller_spec/partial"
end
|
#action_with_partial_with_locals ⇒ Object
55
56
57
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 55
def action_with_partial_with_locals
render :partial => "controller_spec/partial", :locals => {:thing => params[:thing]}
end
|
#action_with_partial_with_object ⇒ Object
51
52
53
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 51
def action_with_partial_with_object
render :partial => "controller_spec/partial", :object => params[:thing]
end
|
#action_with_render_update ⇒ Object
77
78
79
80
81
82
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 77
def action_with_render_update
render :update do |page|
page.replace :bottom, 'replace_me',
:partial => 'non_existent_partial'
end
end
|
#action_with_skipped_before_filter ⇒ Object
84
85
86
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 84
def action_with_skipped_before_filter
render :text => ""
end
|
#action_with_template ⇒ Object
19
20
21
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 19
def action_with_template
render :template => "controller_spec/action_with_template"
end
|
#action_with_two_arg_render ⇒ Object
97
98
99
100
101
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 97
def action_with_two_arg_render
render :update, :status => 404 do |page|
page.visual_effect :highlight, 'user_list'
end
end
|
#raise_error ⇒ Object
4
5
6
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 4
def raise_error
raise "from a before filter"
end
|
#rescued_error_action ⇒ Object
110
111
112
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 110
def rescued_error_action
raise ControllerSpecController::RescuedError
end
|
#some_action ⇒ Object
12
13
14
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 12
def some_action
render :template => "template/that/does/not/actually/exist"
end
|
#some_action_with_implied_template ⇒ Object
16
17
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 16
def some_action_with_implied_template
end
|
#un_rescued_error_action ⇒ Object
114
115
116
|
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/controller_spec_controller.rb', line 114
def un_rescued_error_action
raise ControllerSpecController::UnRescuedError
end
|