cirandas.net

ref: master

test/mocks/test_controller.rb


 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
35
36
37
38
39
40
41
42
class TestController < ApplicationController

  def index
    render :text => 'index', :layout => true
  end

  post_only 'post_only'
  def post_only
    render :text => '<span>post_only</span>'
  end

  def help_with_string
    render :inline => '<%= help "my_help_message" %>'
  end

  def help_with_block
    render :inline => '
      <% help do %>
        my_help_message
      <% end %>
    '
  end

  def help_textile_with_string
    render :inline => '<%= help_textile "*my_bold_help_message*".html_safe %>'
  end

  def help_textile_with_block
    render :inline => '
      <% help_textile do %>
        *my_bold_help_message*
      <% end %>
    '
  end

  def help_without_block
    render :inline => '
      <% help %>
    '
  end

end