File: template_assertions_controller.rb

package info (click to toggle)
ruby-rails-controller-testing 1.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,016 kB
  • sloc: ruby: 646; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class TemplateAssertionsController < ActionController::Base
  def render_nothing
    head :ok
  end

  def render_with_template
    render template: "test/hello_world"
  end

  def render_with_template_repeating_in_path
    render template: "test/hello/hello"
  end

  def render_with_partial
    render partial: 'test/partial'
  end

  def render_file_absolute_path
    render file: File.expand_path('../../../README.rdoc', __FILE__)
  end

  def render_file_relative_path
    render file: '/test/dummy/README.rdoc'
  end

  def render_with_layout
    @variable_for_layout = 'hello'
    render "test/hello_world", layout: "layouts/standard"
  end

  def render_with_layout_and_partial
    render "test/hello_world_with_partial", layout: "layouts/standard"
  end
end