class ActionPackAssertionsController

Public Instance Methods

assign_this() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 55
def assign_this
  @howdy = "ho"
  render inline: "Mr. Henke"
end
flash_me() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 45
def flash_me
  flash["hello"] = "my name is inigo montoya..."
  render plain: "Inconceivable!"
end
flash_me_naked() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 50
def flash_me_naked
  flash.clear
  render plain: "wow!"
end
hello_xml_world() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 9
def hello_xml_world() render template: "test/hello_xml_world"; end
hello_xml_world_pdf() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 11
def hello_xml_world_pdf
  self.content_type = "application/pdf"
  render template: "test/hello_xml_world"
end
hello_xml_world_pdf_header() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 16
def hello_xml_world_pdf_header
  response.headers["Content-Type"] = "application/pdf; charset=utf-8"
  render template: "test/hello_xml_world"
end
nothing() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 7
def nothing() head :ok end
raise_exception_on_get() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 77
def raise_exception_on_get
  raise "get" if request.get?
  render plain: "request method: #{request.env['REQUEST_METHOD']}"
end
raise_exception_on_post() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 82
def raise_exception_on_post
  raise "post" if request.post?
  render plain: "request method: #{request.env['REQUEST_METHOD']}"
end
redirect_external() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 35
def redirect_external() redirect_to "http://www.rubyonquails.org"; end
redirect_external_protocol_relative() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 37
def redirect_external_protocol_relative() redirect_to "//www.rubyonquails.org"; end
redirect_internal() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 21
def redirect_internal() redirect_to "/nothing"; end
redirect_invalid_external_route() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 31
def redirect_invalid_external_route() redirect_to "ht_tp://www.rubyonquails.org" end
redirect_to_action() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 23
def redirect_to_action() redirect_to action: "flash_me", id: 1, params: { "panda" => "fun" }; end
redirect_to_controller() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 25
def redirect_to_controller() redirect_to controller: "elsewhere", action: "flash_me"; end
redirect_to_controller_with_symbol() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 27
def redirect_to_controller_with_symbol() redirect_to controller: :elsewhere, action: :flash_me; end
redirect_to_named_route() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 33
def redirect_to_named_route() redirect_to route_one_url end
redirect_to_path() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 29
def redirect_to_path() redirect_to "/some/path" end
render_based_on_parameters() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 60
def render_based_on_parameters
  render plain: "Mr. #{params[:name]}"
end
render_file_absolute_path() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 87
def render_file_absolute_path
  render file: File.expand_path("../../README.rdoc", __dir__)
end
render_file_relative_path() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 91
def render_file_relative_path
  render file: "README.rdoc"
end
render_text_with_custom_content_type() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 68
def render_text_with_custom_content_type
  render body: "Hello!", content_type: Mime[:rss]
end
render_url() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 64
def render_url
  render html: "<div>#{url_for(action: 'flash_me', only_path: true)}</div>"
end
response404() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 39
def response404() head "404 AWOL" end
response500() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 41
def response500() head "500 Sorry" end
response599() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 43
def response599() head "599 Whoah!" end
session_stuffing() click to toggle source
# File actionpack/test/controller/action_pack_assertions_test.rb, line 72
def session_stuffing
  session["xmas"] = "turkey"
  render plain: "ho ho ho"
end